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

Genetic backtester throwing error after pulling latest code #1026

Open code4passion opened 6 years ago

code4passion commented 6 years ago

Please go to Stack Overflow for help and support:

System information

./scripts/genetic_backtester/darwin.js --days=1 --asset_capital=0 --currency_capital=1000 --selector="gdax.BTC-USD" --population=1 --use_strategies="trend_ema"

Describe the problem

When i run the genetic backtester, the bot throws following exception:

Finished writing generation json to simulations/generation_data_1514770128_gen_2.json Finished writing generation csv to simulations/backtesting_1514770128.csv

Generation's Best Results
    (trend_ema) Sim Fitness undefined, VS Buy and Hold: undefined End Balance: undefined, Wins/Losses undefined/undefined.
/Users/dshetyo/hackspace/zenbot/scripts/genetic_backtester/darwin.js:552
  input = input.params.replace("module.exports =","");
                ^

TypeError: Cannot read property 'params' of undefined
    at generateCommandParams (/Users/dshetyo/hackspace/zenbot/scripts/genetic_backtester/darwin.js:552:17)
    at selectedStrategies.forEach (/Users/dshetyo/hackspace/zenbot/scripts/genetic_backtester/darwin.js:651:29)
    at Array.forEach (<anonymous>)
    at saveGenerationData (/Users/dshetyo/hackspace/zenbot/scripts/genetic_backtester/darwin.js:640:28)
    at fs.writeFile.err (/Users/dshetyo/hackspace/zenbot/scripts/genetic_backtester/darwin.js:575:5)
    at /Users/dshetyo/hackspace/zenbot/scripts/genetic_backtester/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:135:15)
DeviaVir commented 6 years ago

I think this has been resolved by a recently merged PR, would you mind trying again?