Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Add basic docs on darwin.js/ genetic backtester #997

Merged
merged 2 commits into from
Dec 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions docs/scripts/genetic_backtester.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Genetic Backtester - Darwin

The Genetic Backtester will execute a range of simulations with a range of parameters, limited by the population size, per strategy. Once all sims in the population are complete, the top results are taken as the starting point for the next generation. This continues indefinitely, until interrupted by the user.

## Installation

This script has additional node dependencies that need to be installed before usage:

```bash
cd scripts/genetic_backtester
npm install
cd ../../
```

## Usage

Launch the genetic backtester from the zenbot root by directly invoking darwin.js:
```bash
./scripts/genetic_backtester/darwin.js --days=30 --asset_capital=0 --currency_capital=1000 --selector="gdax.BTC-USD" --population=150 --use_strategies="macd,trend_ema"
```

## Parameters

The following parameters are available when executing darwin.js:
```
// Primary Parameters
--use_strategies="strategyname" # comma separated strategy list to test with. Leave blank to test all.
--population_data=./simulations/generation_data_1514280516_gen_582.json # (optional) continue backtesting from a specific generation
--population=150 # (optional) number of simulation per generation

// General Parameters
--selector="gdax.BTC-USD" # selector to run simulations on
--days=30 # how many days to execute per simulation
--currency_capital=1000 # currency amount to start simulations with. Needs to be bigger than 0 (see issue #449).
--asset_capital=0 # (optional) asset amount to start simulations with.

```

## Results

When the next generation starts testing, a csv file will appear in the simulations folder. This CSV contains all simulations that were executed in that generation, including the parameters and results.

The top results are listed at the top of the file, in descending order.

## Further Customization

The default ranges can be further customized per strategy by editing the [darwin.js](blob/master/scripts/genetic_backtester/darwin.js) script.
7 changes: 7 additions & 0 deletions docs/scripts/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Scripts
In the scripts folder are a number of helper scripts. This is the corresponding documentation so far, with more information on each set of scripts:

* [auto_backtester](auto_backtester.md) *not done yet, contributions welcome*
* [genetic_algo](genetic_algo.md) *not done yet, contributions welcome*
* [Genetic Backtester](genetic_backtester.md)