Genetic_backtester "Bad output detected TypeError:"
System information
- Have I written custom code (as opposed to using zenbot vanilla):
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04.3 LTS
- Zenbot version: 4.0.5
- NodeJS version: 8.9.3
- Python version: 2.7.11
- Exact command to reproduce: ./scripts/genetic_backtester/darwin.js --selector="poloniex.EMC2-BTC" --days=7 --currency_capital=0.00322810 --use_strategies=neural
Describe the problem
Error: Bad output detected TypeError: Cannot read property '1' of null
Source code / logs
Running ./zenbot.sh sim gdax.ETH-EUR --days=30 --currency_capital=1000 --filename none --strategy=neural --period=39m --min_periods=3 --markup_pct=1.6790605615486454 --order_type=maker --sell_stop_pct=28 --buy_stop_pct=0 --profit_stop_enable_pct=14 --profit_stop_pct=6 --activation_1_type=relu --neurons_1=126 --depth=13 --momentum=72 --decay=1 --min_predict=69 --learns=139 returns the following:
node-telegram-bot-api deprecated Automatic enabling of cancellation of promises is deprecated.
In the future, you will have to enable it yourself.
See https://github.com/yagop/node-telegram-bot-api/issues/319. module.js:660:30
node-telegram-bot-api deprecated Automatic enabling of cancellation of promises is deprecated.
In the future, you will have to enable it yourself.
See https://github.com/yagop/node-telegram-bot-api/issues/319. module.js:660:30
2017-11-19 23:56:38 304.070 ETH-EUR +0.35% 238 00000.000 00000.000 sell
/root/zenbot/extensions/strategies/neural/strategy.js:61
for (let i = 0; i < s.options.min_predict; i++) { tlp.push(s.lookback[i].close) }
^
TypeError: Cannot read property 'close' of undefined
at Object.onPeriod (/root/zenbot/extensions/strategies/neural/strategy.js:61:84)
at Array.<anonymous> (/root/zenbot/lib/engine.js:811:35)
at Immediate.each (/root/zenbot/node_modules/run-series/index.js:17:24)
at runCallback (timers.js:773:18)
at tryOnImmediate (timers.js:734:5)
at processImmediate [as _immediateCallback] (timers.js:711:5)
https://github.com/carlos8f/zenbot/blob/49a763a22c4b9a74f864c3b8f7ce9e8a65a52f53/extensions/strategies/neural/strategy.js#L59-L61 It will throw an error if min_predict is higher than min_periods as s.lookback is not properly filled.
Taking @DarkShimy00's suggestion there, I cap min_predict to avoid that scenario. I've been running it for a couple of days and so far so good.