panifie / PingPong.jl

Cryptocurrency trading bot, and backtesting framework in julia
https://panifie.github.io/PingPong.jl/
GNU General Public License v3.0
36 stars 9 forks source link

load_ohlcv(s) : ERROR: UndefVarError: `compactun` not defined #37

Closed janckerchen closed 3 weeks ago

janckerchen commented 3 weeks ago

Follow the package documentation for validation.

...
s = st.strategy(:SimpleStrategy, exchange=:okx) 
fetch_ohlcv(s, from=-1000) 
load_ohlcv(s) # <---------------error
...

output

julia> s = st.strategy(:SimpleStrategy, exchange=:okx)
Importing SimpleStrategy [9faf1dd7-6398-46c6-90c9-24e0234666dd].
Name: SimpleStrategy (Sim)
Config: nomargin, 10.0(USDT)(Base Size), 100.0(USDT)(Initial Cash)
Universe: 1 instances, 1 exchanges
Trades: 0 ~ 0
Holdings: 0
Pending buys: 0
Pending sells: 0
USDT: 100.0 (on okx) (Cash)
USDT: 100.0 (Total)
julia> fetch_ohlcv(s, from=-1000)
┌ Warning: fetch: (okx) likely ignores `since` argument
│   since_date = 2021-09-23T00:00:00
│   dt(since_ts) = 2021-09-23T15:29:34.417
│   dt(from) = 2021-09-23T15:29:34.417
│   pair = "BTC/USDT"
└ @ Fetch /opt/opensource/jl/PingPong.jl/Fetch/src/impl.jl:221
Dict{String, Data.PairData} with 1 entry:
  "BTC/USDT" => PairData("BTC/USDT", "1d", 299×6 DataFrame…

julia> load_ohlcv(s)
Error showing value of type DataFrames.DataFrame:
ERROR: UndefVarError: `compactun` not defined
Stacktrace:
  [1] print(io::IOContext{IOBuffer}, ai::AssetInstance{Asset, ExchangeID{:okx}, NoMargin})
    @ Instances /opt/opensource/jl/PingPong.jl/Instances/src/module.jl:715
  [2] sprint(f::Function, args::AssetInstance{Asset, ExchangeID{:okx}, NoMargin}; context::IOContext{Base.TTY}, sizehint::Int64)
    @ Base ./strings/io.jl:112
  [3] _text_render_cell(::Val{…}, io::IOContext, v::AssetInstance{…}; compact_printing::Bool, isstring::Bool, limit_printing::Bool, linebreaks::Bool)
    @ PrettyTables ~/.julia/packages/PrettyTables/E8rPJ/src/backends/text/render.jl:47
  [4] _text_render_cell
panbonker commented 3 weeks ago

that's a typo in the print function abe72e898557387458f06ca3bd05d6df6652c51b