BacktestTool - batch backtest, import and strategy parameters optimalization
#1
I present Gekko's BacktestTool. Script written in Perl.

How it's work?
The tool allows you to perform multiple backtests on previously defined multiple pairs, strategies and candleSize. All you have to do is enter your variables into the configuration file and run the program. Then BacktestTool will perform all the tasks you have ordered. Results are printed as terminal output and saved in csv file. Example of csv file is here: https://github.com/xFFFFF/Gekko-Strategi...tabase.csv

Features
- Test multiple candleSize, strategies and mulitple pairs on one run
- Start multiple PaperTraders
- Multiple datasets import
- Backtests results are exported to CSV file
- Multithreading - in contrast to raw Gekko backtest this tool uses 100% of your processor
- Extended statistics

DEMO 
Start backtests
[Image: backtest.gif]

All results are exported to CSV file (You can open it in Excel or LibreOffice Calc)
[Image: csv.gif]

Installation
1. Clone git https://github.com/xFFFFF/GekkoBacktestTool.git
2. Copy files to Gekko's main directory
3. Install dependies by command: 

Code:
$ sudo cpan install Parallel::ForkManager Time::ParseDate Time::Elapsed Getopt::Long List::MoreUtils File::chdir Statistics::Basic DBI

4. Edit backtest-config.pl in text editor.

Run
for backtest: 

Code:
$ perl backtest.pl 

For import: 

Code:
$ perl backtest.pl -i 

For start multiple paperTraders: 

Code:
$ perl backtest.pl -p

Available commands:
Code:
usage: perl backtest.pl
To run backtests machine

usage: perl backtest.pl [parameter] [optional parameter]
Parameters:
 -i, --import     - Import new datasets
 -g, --paper     - Start multiple sessions of PaperTrader
 -v, --convert     - Convert TOML file to Gekko's CLI config format, ex: backtest.pl -v MACD.toml
 
Optional parameters:
 -c, --config         - BacktestTool config file. Default is backtest-config.pl
 -s, --strat STRATEGY_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.
 -f, --from
 -f last        - Start import from last candle available in DB. If pair not exist in DB then start from 24h ago.
 -t, --to         - Time range for backtest datasets or import. Example: backtest.pl --from="2018-01-01 09:10" --to="2018-01-05 12:23"
 -t now        - 'now' is current time in GMT.
 -o, --output FILENAME - CSV file name.

Example usage:
Backtests of all available pairs for Binance Exchange in Gekko's scan datarange mode:
Code:
$ 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:
Code:
$ perl backtest.pl -n 5:144,10:73,20:36,40:15`

Import all new candles for all BNB pairs:
Code:
$ 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:
Code:
$ perl backtest.pl -i -f 2017-01-02 -t now`

Sample backtest output
Link: https://github.com/xFFFFF/Gekko-Backtest...output.csv

Github

Check our Git for more info: https://github.com/xFFFFF/GekkoBacktestTool
Feel free to submit suggestions or features request.
  Reply


Messages In This Thread
BacktestTool - batch backtest, import and strategy parameters optimalization - by xFFFFF - 02-27-2018, 12:22 AM
RE: Gekko backtest tool - by PapoKarlo - 03-20-2018, 05:39 PM
RE: Gekko backtest tool - by CryptoCoeus - 09-22-2018, 02:08 PM
0.00 Profit - by danibeni81 - 08-19-2018, 07:55 PM

Forum Jump:


Users browsing this thread: