when I try paper trader in CLI, I get a "RangeError: Maximum call stack size exceeded" error.
 If I lower the trading advisor required history size below 4000, the paper trader will work, but over this number I will get an error. Any way around this? 

I need the history size to be high because I am running a strategy that utilizes multiple candle sizes in the strategy.

I am running this on Windows 10 and installed without bash. 

EventEmitter.prototype.emit = function emit(type) {
RangeError: Maximum call stack size exceeded

any ideas?

Attached Files
.txt   log.txt (Size: 5.36 KB / Downloads: 3)
Very strange, do you have this for other exchanges as well?

Also, can you post the output of running:

node gekko --version
You may try to set batchSize: 1 in your config. Had the same error before figuring out, that a stream backpressure is possible to happen. Stream reader is pushing like maniac during backtest and when the written stream (your strategy) is not fast enough due to many indicators, the stack and memory consumption is growing. You can measure this by running gekko with gnu time, e.g.:

/usr/bin/time --verbose node gekko.js --config myconfig.js --backtest

When memory consumption is below 100MB you probably have no backpressure and backtest results are fine. During a 10 month backtest I had a memory consumption of 850!! MB, dropping candles and wrong backtest results. Delaying the stream reader in backtest.js with a setTimeout completely fixed the issue. This is a quickfix, better is to fix the implementation according the stream read/write best practice: https://nodejs.org/en/docs/guides/backpr...n-streams/
(10-24-2018, 06:23 AM)askmike Wrote: Very strange, do you have this for other exchanges as well?

Also, can you post the output of running:

node gekko --version

Here is the version..... I have tried it on both Binance and gdax and see this issue. 
Gekko version: v0.6.6
Nodejs version: v8.12.0

I am able to backtest without problem in CLI, it is when I try using paper trader that the issue occurs.
Ok, if your CLI version works well, the backpressure bug probably did not appear in your test...will move the backpressure thing to the github bugtracker
Did you ever get to the bottom of this? I've just started getting the same error, but when starting a CLI trade bot, paper or live, again with 1 minute candles and long history size as I'm using my own candle batcher.

I haven't tried a CLI backtest, but the strategy runs fine in a UI backtest for me.

The error appears both on a windows machine and my Ubuntu vps.

I've opened an issue on github here: https://github.com/askmike/gekko/issues/2622
I was able to work around this error by switching from 1 minute to 5 minute candles..

 Still haven't found a way to make it work with 1 minute candles and larger than 4000 historysize.
I've replied on the github issue!

Forum Jump:

Users browsing this thread: