-
Notifications
You must be signed in to change notification settings - Fork 2k
Zenbot sim stall/timeout in 4.1.0 unstable #2412
Comments
BTW, reading another thread, I see a reference to this older version of sim.js When I replace mine with that one, sim works again. Not a huge diff, but worth looking at. |
It's not really fixed.. lots of runs stall out/die - darwin backtester won't complete due to stalled sims. Something still wrong. |
I've got the same problem too. |
I've found the problem guys, if you go to engine.js and you comment line 761 the problem is solved.
Using lolex is causing the issue. I've tried replacing lolex with "@sinonjs/fake-timers": "^6.0.1", and it didn't solve the problem. Also I removed the use of async/await in sim.js, it didn't work either. I don't want to create a PR removing lolex since I don't know how much it affects the simulation result due to my lack of experience with zenbot. |
So, removing the use of lolex produced bad simulations. So it is not a solution at all, I updated my dockerfile to use node:12-alpine and it solved the problem and now simulations are making sense. |
I'm using NVM, and have flipped back and forth between 10, 12, and 14, in some cases with a a full rm/git clone.. 12 seems to complain the least, but doesn't solve the problem, at least for me. Fresh git pull, "nvm use lts/erbium (-> v12.18.4" npm install, 2020-09-30 16:15:50 0.0747600 XLM-USDT +0.12% 93508 |
I can confirm that commenting out line 761, as indicated above, DOES stop the stall, 100% of the time. Does make me very worried about the truth of the simulations however. 😞 end balance: 185109.51385183 (1751.09%) Fairly unlikely. :( |
tried [email protected], 5.1.0, 4.1.0, 3.1.0, 2.1.0, 2.0.0, even 1.0.0 for fun, no change in behavior (other than 1.0.0 not working at all). Combined with @brianunlam 's work replacing it with fake-timers, I think it's probably not the lolex library, but some combination/way it's being invoked. |
If you remove lolex the simulation doesn't work properly. The exact version of node is v12.18.4, please try that. @dlasher |
@dlasher Finally I've found the problem. It was related to lolex. Basically since version 3.6.2 mongodb replaced processWaitQueue with setImmediate. lolex.install() is monkey patching setImmediate. So that is causing mongodb library to stall. Here you can see more details about this: |
It should solve the issue: |
Grabbed the updated engine.js in #2425, put the "new" version of sim.js back in, and VOILA!! Problem solved gentlemen! Thank you, and well done! |
Describe the problem
git pulled most recent version 2 days ago, now "./zenbot.sh sim" does.. nothing.
thinking it was the mongodb, I repaired it. nada. destroyed it all, and backfilled again. nada. tried it on another machine. and another. Something broke SIM in current version, across multiple NODE versions (10/12/14) across multiple ubuntu version.
works:
./zenbot.sh trade binance.BTC-USDT --paper --period=10m --trend_ema=35 --enable_stats --debug --verbose --days 7
fetching pre-roll data:
binance.BTC-USDT saved 23349 trades 1 days left
stalls forever:
./zenbot.sh sim binance.BTC-USDT trade --paper --period=10m --trend_ema=35 --enable_stats --debug --verbose --days 7
fresh install vis git into new folder, changing NOTHING else. Stalls.
Source code / Error logs
no error log - it just sits for a good couple minutes, then returns to the prompt.
The text was updated successfully, but these errors were encountered: