zenbot
zenbot copied to clipboard
Error while Running SAR Strategy
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
- Zenbot version (commit ref, or version): Zenbot4
- Zenbot branch: master
- NodeJS version: v9.11.2
- Python version (when using a python script): Python 3.5.2
- Exact command to reproduce (include everything): ./zenbot.sh trade binance.AST-BTC --conf conf.js --strategy sar
- Did I make any changes to conf-sample.js?: Only Added API Keys for Binance and Telegram
Describe the problem
I am getting the following error when running sar strategy in trade mode. sim runs just fine. To debug I have put a console.log for s.lookback. This array has only one element.
Source code / Error logs
/home/ujesh/zenbot/extensions/strategies/sar/strategy.js:33 s.sar = Math.max(s.lookback[1].high, s.lookback[0].high) ^
TypeError: Cannot read property 'high' of undefined
at Object.calculate (/home/ujesh/zenbot/extensions/strategies/sar/strategy.js:33:42)
at updatePeriod (/home/ujesh/zenbot/lib/engine.js:162:16)
at withOnPeriod (/home/ujesh/zenbot/lib/engine.js:758:5)
at /home/ujesh/zenbot/lib/engine.js:934:9
at Object.onPeriod (/home/ujesh/zenbot/extensions/strategies/sar/strategy.js:86:5)
at onTrade (/home/ujesh/zenbot/lib/engine.js:921:27)
at /home/ujesh/zenbot/lib/engine.js:899:5
at /home/ujesh/zenbot/node_modules/async/dist/async.js:4096:9
at Object.process (/home/ujesh/zenbot/node_modules/async/dist/async.js:2344:17)
at /home/ujesh/zenbot/node_modules/async/dist/async.js:2252:19
at Immediate.
Same here I have unmolested code however I am running ubuntu inside vm from windows host.
ERROR: s.sar = Math.max(s.lookback[1].high, s.lookback[0].high) ^ TypeError: Cannot read property 'high' of undefined at Object.calculate (/home/ubuntu/zenbot/extensions/strategies/sar/strategy.js:32:42) at updatePeriod (/home/ubuntu/zenbot/lib/engine.js:162:16) at withOnPeriod (/home/ubuntu/zenbot/lib/engine.js:757:5) at /home/ubuntu/zenbot/lib/engine.js:933:9 at Object.onPeriod (/home/ubuntu/zenbot/extensions/strategies/sar/strategy.js:85:5) at onTrade (/home/ubuntu/zenbot/lib/engine.js:920:27) at /home/ubuntu/zenbot/lib/engine.js:898:5 at /home/ubuntu/zenbot/node_modules/async/dist/async.js:4096:9 at Object.process (/home/ubuntu/zenbot/node_modules/async/dist/async.js:2344:17) at /home/ubuntu/zenbot/node_modules/async/dist/async.js:2252:19
Hello.
I am sure you guys have long since resolved that error...
But this resolved it for me: npm install express-rate-limit ./zenbot.sh --conf someconf --period=2m --period-length=2m --min_periods=52
-Jeff C
Hello
I get a similar error with the pivot strategy and tried your fix. Getting: error: unknown option `--conf' Any thoughts? Can't find a solution anywhere. Thanks
/zenbot/extensions/strategies/pivot/strategy.js:36 if (s.lookback[5].high <= s.lookback[1].high && s.lookback[4].high <= s.lookback[1].high && s.lookback[3].high <= s.lookback[1].high && s.lookback[2].high <= s.lookback[1].high && s.lookback[0].high <= s.lookback[1].high && s.period.high <= s.lookback[1].high) { ^
TypeError: Cannot read property 'high' of undefined at Object.onPeriod (/home/user/zenbot/extensions/strategies/pivot/strategy.js:36:25) at onTrade (/home/user/zenbot/lib/engine.js:896:27) at /home/user/zenbot/lib/engine.js:874:5 at /home/user/zenbot/node_modules/async/dist/async.js:4096:9 at Object.process (/home/user/zenbot/node_modules/async/dist/async.js:2344:17) at /home/user/zenbot/node_modules/async/dist/async.js:2252:19 at Immediate._onImmediate (/home/user/zenbot/node_modules/async/dist/async.js:119:16) at runCallback (timers.js:810:20) at tryOnImmediate (timers.js:768:5) at processImmediate [as _immediateCallback] (timers.js:745:5)
./zenbot.sh trade --conf someconf.js --period=2m --period-length=2m --min_periods=52
I forgot to add 'trade' between .sh and --conf