Giter Club home page Giter Club logo

Comments (5)

panbonker avatar panbonker commented on June 21, 2024 1

/pingpong is the main repo path. Package directories are camel cased, so you want to do

begin
    import Pkg
    Pkg.activate("/pingpong/PingPongInteractive") # or "/pingpong/PingPong"
    using PingPongInteractive
end

from pingpong.jl.

femtotrader avatar femtotrader commented on June 21, 2024

I'd be pleased to help on this when I will understand PingPong.jl features.

Here is what I did to have a Pluto notebook running with PingPong and a Docker configuration (thanks to #19)

I created a custom/Dockerfile file like so

FROM docker.io/panifie/pingpong-precomp-interactive
RUN julia -e 'using Pkg; Pkg.add("Pluto")' 
ENTRYPOINT [ "julia", "-e", "using Pluto; Pluto.run(; host=\"0.0.0.0\")"]

I create a docker-compose.yml like so

services:
  pingpong:
    #image: pingpong-precomp-interactive
    build:
      context: custom
      dockerfile: Dockerfile
    #restart: unless-stopped
    volumes:
      - ./user:/pingpong/user
    ports:
      - 127.0.0.1:1234:1234

I ran this container using

docker compose up

I looked at logs, browsed to http://127.0.0.1:1234/?secret=XXXXXX and created a new notebook with the following content

begin
    import Pkg
    # activate a temporary environment
    #Pkg.activate(mktempdir())
	Pkg.activate("/pingpong")
	#Pkg.add("Term")
	Pkg.instantiate()
end

unfortunately

using PingPong

raised

ArgumentError: Package PingPong not found in current path.

- Run `import Pkg; Pkg.add("PingPong")` to install the PingPong package.

from pingpong.jl.

femtotrader avatar femtotrader commented on June 21, 2024

Thanks @panbonker .

Can't understand why I didn't found that myself! Thanks

Here's a work in progress

# v0.19.41

using Markdown
using InteractiveUtils

# ╔═╡ 24d485ab-9bc8-4110-aaa4-cc084324efc3
begin
    import Pkg
    Pkg.activate("/pingpong/PingPongInteractive")
    Pkg.instantiate()
end

# ╔═╡ b1830dda-6bc8-4f30-a36e-81406010dd58
begin
    using PingPong
    using Strategies: Strategies as st
    using Scrapers: Scrapers as scr
    using Data: Data as data
    using SimMode: SimMode as sm
    using Instruments: Instruments as ins
    using Data: Data as da
end

# ╔═╡ 3ed5e59a-ca10-4a13-aa6d-41752b34f8f5
s = st.strategy(:Example) # `st` is the `Strategies` module

# ╔═╡ 74a70750-d11c-47da-b090-9567c541af68
begin
    pairs = ins.raw.(s.universe.data.asset) # `ins` is the Instruments module
    const bn = scr.BinanceData  # `scr` is the Scrapers module
    bn.binancedownload(pairs)
end

# ╔═╡ b616952e-7756-4918-b9e5-2e56879eaba2
let data = bn.binanceload(pairs)
    da.stub!(s.universe, data) # `da` is the `Data` module
end

# ╔═╡ Cell order:
# ╠═24d485ab-9bc8-4110-aaa4-cc084324efc3
# ╠═b1830dda-6bc8-4f30-a36e-81406010dd58
# ╠═3ed5e59a-ca10-4a13-aa6d-41752b34f8f5
# ╠═74a70750-d11c-47da-b090-9567c541af68
# ╠═b616952e-7756-4918-b9e5-2e56879eaba2

but #33 is blocking

from pingpong.jl.

femtotrader avatar femtotrader commented on June 21, 2024

My opinion it that a very basic notebook with a simple strategy such as MA cross with one symbol, no margin should be written.
Ideally this strategy should be exchange independant and use simply daily data from an exchange which provide enough data.

from pingpong.jl.

panbonker avatar panbonker commented on June 21, 2024

you can pass a different exchange (and any other config) with st.strategy(:Example, exchange=:exc but a real exchange is always necessary because there is tight integration with information which is exchange specific, like precision, limits, leverage tiers, fees...

if you really wanted, you could use an exchange built with an empty symbol (getexchange!(Symbol())), try to run a backtest, and specialize functions with arbitrary default value until it stops throwing method errors...the exchange api is not well packed in one module currently

in absence of a specific exchange there are also api wrappers for coingecko/coinpaprika for getting ohlcv data

anyway I have updated the docs with the 1D strategy SimpleStrategy

from pingpong.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.