DeviaVir / zenbot

Zenbot is a command-line cryptocurrency trading bot using Node.js and MongoDB.
MIT License
8.23k stars 2.04k forks source link

Constant Bug in Genetic Backtester #1236

Open kilowatt1 opened 6 years ago

kilowatt1 commented 6 years ago

Logs: ./zenbot.sh sim gdax.ltc-eur --period_length=36m --min_periods=119 --markdown_buy_pct=2.692266657499561 --markup_sell_pct=4.744030757398114 --order_type=maker --sell_stop_pct=0 --buy_stop_pct=38 --profit_stop_enable_pct=0 --profit_stop_pct=5 --cci_periods=142 --rsi_periods=143 --srsi_periods=199 --srsi_k=23 --srsi_d=44 --oversold_rsi=45 --overbought_rsi=70 --oversold_cci=62 --overbought_cci=76 --constant=0.03980302101693896 --backtester_generation=366 --exchangeMarketPair=gdax.ltc-eur --strategy=cci_srsi --days=10 --currency_capital=4500 --filename=none undefined:636 throw createError(name, arguments.length, 0, arguments[0], 'number,Complex,BigNumber,Fraction,Array,Matrix'); ^

TypeError: Unexpected type of argument in function round (expected: number or Complex or BigNumber or Fraction or Array or Matrix, actual: undefined, index: 0) at createError (/root/zenbot/node_modules/typed-function/typed-function.js:135:17) at Object.round (eval at _typed (/root/zenbot/node_modules/typed-function/typed-function.js:1118:22), :636:9) at srsi (/root/zenbot/lib/srsi.js:57:62) at Object.calculate (/root/zenbot/extensions/strategies/cci_srsi/strategy.js:34:20) at onTrade (/root/zenbot/lib/engine.js:155:18) at withOnPeriod (/root/zenbot/lib/engine.js:874:15) at /root/zenbot/lib/engine.js:867:17 at Object.onPeriod (/root/zenbot/extensions/strategies/cci_srsi/strategy.js:85:7) at Array. (/root/zenbot/lib/engine.js:854:35) at Immediate.each [as _onImmediate] (/root/zenbot/node_modules/run-series/index.js:17:24) at runCallback (timers.js:789:20) at tryOnImmediate (timers.js:751:5) at processImmediate [as _immediateCallback] (timers.js:722:5)

Describe the problem

When running genetic backtester, i get the above error which seems to be coming from the large number in constant that it auto generated.

station384 commented 6 years ago

cci_srsi limits need to be adjusted in darwin.js. they are out of acceptable range. I came across this as well.

kilowatt1 commented 6 years ago

How do we do that, can you post your config please