CLI tool that enhances the features of Gekko's Trading Bot. The tool performs a test with multiple pairs on a single run. Suppose you have a strategy that you want to test on more currency pairs. You enter all the pairs on which you want to test the strategy for the BacktestTool's configuration file. You start the application and everything happens automatically. You are just waiting for the results that appear on the screen. You will see how your strategy falls on other pairs, where it works the best, and where the worst. More detailed data is available in the .CSV file, which you can open in a spreadsheet or text editor. You can do the same with many strategies and CandleSize values. You can test all your strategies on eg BTC-USD pair and compare results, which will allow you to choose the best strategy you will use in live trade.
$ sudo cpan install Parallel::ForkManager Time::Elapsed Getopt::Long List::MoreUtils File::chdir Statistics::Basic DBI DBD::SQLite JSON::XS TOML File::Basename File::Find::Wanted Template LWP::UserAgent LWP::Protocol::https Set::CrossProduct DBD::CSV Text::Table File::Copy
$ su
$ cpan install Parallel::ForkManager Time::Elapsed Getopt::Long List::MoreUtils File::chdir Statistics::Basic DBI DBD::SQLite JSON::XS TOML File::Basename File::Find::Wanted Template LWP::UserAgent LWP::Protocol::https Set::CrossProduct DBD::CSV Text::Table File::Copy
cpan install Parallel::ForkManager Time::Elapsed Getopt::Long List::MoreUtils File::chdir Statistics::Basic DBI DBD::SQLite JSON::XS TOML File::Basename File::Find::Wanted Template LWP::UserAgent LWP::Protocol::https Set::CrossProduct DBD::CSV Text::Table File::Copy
The installation tutorial by bald123 can be found in the Wiki: Docker installation.
cd C:\Users\xFFFFF\Desktop\gekko
cd /home/xFFFFF/gekko
chmod +x backtest
perl backtest.pl
./backtest
usage: perl backtest.pl
To run backtests machine
usage: perl backtest.pl [mode] [optional parameter]
To run other features
Mode:
-i, --import - Import new datasets
-g, --paper - Start multiple sessions of PaperTrader
-v, --convert TOMLFILE - Convert TOML file to Gekko's CLI config format, ex: backtest.pl -v MACD.toml
-a, --analyze CSVFILE - Perform comparision of strategies and pairs from csv file, ex: backtest.pl -a database.csv
Optional parameters:
-c, --config - BacktestTool config file. Default is backtest-config.pl
-s, --strat STRAT_NAME - Define strategies for backtests. You can add multiple strategies seperated by commas example: backtest.pl --strat=MACD,CCI
-p, --pair PAIR - Define pairs to backtest in exchange:currency:asset format ex: backtest.pl --p bitfinex:USD:AVT. You can add multiple pairs seperated by commas.
-p exchange:ALL - Perform action on all available pairs. Other usage: exchange:USD:ALL to perform action for all USD pairs.
-n, --candle CANDLE - Define candleSize and warmup period for backtest in candleSize:warmup format, ex: backtest.pl -n 5:144,10:73. You can add multiple values seperated by commas.
-ft, --period DAYS - Time range in days - perform action on period from last x days ex: backtest.pl -ft 7
-f, --from - Time range for backtest datasets or import. Example: backtest.pl --from="2018-01-01 09:10" --to="2018-01-05 12:23"
-t, --to
-f last - Start import from last candle available in DB. If pair not exist in DB then start from 24h ago.
-t now - 'now' is current time in GMT.
-o, --output FILENAME - CSV file name.
Backtests of all available pairs for Binance Exchange in Gekko's scan datarange mode:
$ perl backtest.pl -p binance:ALL
Backtest on all pairs and strategies defined in backtest-config.pl with candles 5, 10, 20, 40 and 12 hours warmup period:
$ perl backtest.pl -n 5:144,10:73,20:36,40:15
Import all new candles for all BNB pairs:
$ perl backtest.pl -i -p binance:BNB:ALL -f last -t now
Import all candles for pairs defined in backtest-config.pl from 2017-01-02 to now:
$ perl backtest.pl -i -f 2017-01-02 -t now
Search best parameters for strategy: edit TOML file in config/strategies The above example will generate 15 backtests with unique configurations. Syntax for brute force is: start..end: step (as in the case of TimePeriod) or value1, value2, value3 (example from interval). The generated values for TimePeriod are 15, 20, 25. After saving the file, run the backtest of the given strategy, eg backtest.pl -s BBRSI.