DeviaVir / zenbot

Zenbot is a command-line cryptocurrency trading bot using Node.js and MongoDB.
MIT License
8.23k stars 2.03k forks source link

Resuming of Darwin is broken #1452

Closed glennfu closed 6 years ago

glennfu commented 6 years ago

I'm gonna fix it, just marking this here to let people know I'm aware of it.

198: 98.4% ETA: 0m 0s
Done: 200, Active: 0, Remaining: 0, Errored: 21, Completion: 100.0% Best Balance(92): 0.0109

Generation 6 completed at 2018-03-01 19:38:29, took 7m 46s, results saved to:
TypeError: Cannot read property 'commandString' of undefined
    at ~/Projects/zenbot/scripts/genetic_backtester/darwin.js:244:48
    at Array.forEach (<anonymous>)
    at parallel (/Users/Glenn/Projects/zenbotn/scripts/genetic_backtester/darwin.js:238:13)
    at end (/Users/Glenn/Projects/zenbotn/scripts/genetic_backtester/node_modules/run-parallel-limit/index.js:17:15)
    at done (/Users/Glenn/Projects/zenbotn/scripts/genetic_backtester/node_modules/run-parallel-limit/index.js:21:10)
    at each (/Users/Glenn/Projects/zenbotn/scripts/genetic_backtester/node_modules/run-parallel-limit/index.js:28:7)
    at /Users/Glenn/Projects/zenbotn/scripts/genetic_backtester/node_modules/run-parallel-limit/index.js:38:45
    at ChildProcess.proc.on (/Users/Glenn/Projects/zenbotn/lib/backtester.js:519:7)
    at ChildProcess.emit (events.js:159:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
travisstaloch commented 6 years ago

Should it work if you delete the current gen directory and then resume?

I had thought this was working until recently I noticed a resumed backtest showed a great fitness/balance through gen4. But when I stopped it, deleted gen5 directory and resumed it took until gen20 (with a smaller pop size) to get back to around the same fitness/balance. I was confused about what had happened. I noticed this using 4.1.0.

glennfu commented 6 years ago

Yes that should definitely work as well

travisstaloch commented 6 years ago

I have had no luck deleting the most recent gen directory and restarting darwin with the same command. It seems like darwin starts over at gen 0. After restarting, the next gen results are no where near those of gens previous to restart. I also tried just deleting the results.csv and results.json files and leaving the completed gen sim_x.json files, but this didn't work.

I may have found a clue. Using a pull from Mar 8th, I noticed that when resuming darwin after deleting the results.csv and results.json, the new results.csv file is written at generation end but the Selector and Fitness columns at the beginning of each row are empty. Also, the results aren't sorted by fitness.

Could this be what is causing the problems? Any ideas why this might be happening or how to fix this?

I would like to work together in some capacity with who ever is working on this be it testing or coding or anything else. I really look forward to making this happen. I've been looking through darwin.js and backtester.js trying to find a problem. No luck yet.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.