Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Genetic_backtester "Bad output detected TypeError:" #924

Closed
kazdimenator opened this issue Dec 18, 2017 · 3 comments
Closed

Genetic_backtester "Bad output detected TypeError:" #924

kazdimenator opened this issue Dec 18, 2017 · 3 comments
Labels

Comments

@kazdimenator
Copy link

kazdimenator commented Dec 18, 2017

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

neural

@DeviaVir DeviaVir added the bug label Dec 19, 2017
@DarkShimy00
Copy link

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)

@DarkShimy00
Copy link

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.

@glennfu
Copy link
Contributor

glennfu commented Dec 27, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants