10-24-2018, 08:46 AM
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/
/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/