DeviaVir / zenbot

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

feature request: Add Strategies tester #378

Closed mkuendig closed 7 years ago

mkuendig commented 7 years ago

Have created a small strategies tester script. Could we add something like this?

get available strategies from folder

strategies=$(ls -1 extensions/strategies)

for s in $strategies do echo "Tested strategy $s" ./zenbot.sh sim --days 15 --strategy $s done

DeviaVir commented 7 years ago

https://github.com/carlos8f/zenbot/tree/master/scripts/auto_backtester doesn't do more or less what you want?

mkuendig commented 7 years ago

Thanks @DeviaVir . Yup, that is pretty close.

I have enhanced my script to use it and the script is now:

npm install shelljs run-parallel-limit json2csv fs round-precision

#change script to make it docker compatible
sed -i.bak "s&zenbot sim&./zenbot.sh sim&g" scripts/auto_backtester/backtester.js

#get available strategies from folder
strategies=$(ls -1 extensions/strategies)

for s in $strategies
    do
    echo "Tested strategy $s"
       ./scripts/auto_backtester/backtester.js poloniex.ETH-USDT --days 15 $s
done

Two things:

Tested strategy cci_srsi

--==Zenbot 4.04 Backtester v0.2==-- Wed, 12 Jul 2017 03:20:48 GMT

Backtesting [176] iterations for strategy trend_ema...

[ 1/176 ] ./zenbot.sh sim poloniex.ETH-USDT --days 15 cci_srsi --trend_ema=20 --oversold_rsi=20 --oversold_rsi_periods=15 --neutral_rate=0.1 --period=2m --min_periods=52 [ 2/176 ] ./zenbot.sh sim poloniex.ETH-USDT --days 15 cci_srsi --trend_ema=20 --oversold_rsi=21 --oversold_rsi_periods=15 --neutral_rate=0.1 --period=2m --min_periods=52

asafyish commented 7 years ago

I got multiple csv files, How do you compare the results ?

mkuendig commented 7 years ago

sort each csv so that you have the best result on top. Then use the strategy that yields the best return. I have abandoned the auto-tester and use now the new ML feature introduced: https://github.com/carlos8f/zenbot/blob/master/commands/train.js