Skip to content

Other Resources

iterativ edited this page Aug 19, 2021 · 3 revisions

BackTest locally

Install Docker Compose.

Run the backtesting command:

docker-compose run --rm backtesting

Test locally

Install Docker Compose.

Run the tests command:

docker-compose run --rm tests

Configure run

If you want to change --max-open-trades or --stake-amount or --timerange change the .env file.

Update pairs or timeframe

From the NostalgiaForInfinityData repository

git submodule update --remote --checkout

Locally

If you want to update pairs user_data/data/pairlists.json from exchange:pair_whitelist or timeframe from docker-compose.yml from download-data:timerange, run the following after you changed.

docker-compose run --rm download-data

Do note that this will update the data locally on the git submodule. But it should still work.

Updating Pairs or Timeframe - Long Term

To update either the pair list or the downloaded data time frames, please check NostalgiaForInfinityData and proceed from there.

Once the necessary changes are done in NostalgiaForInfinityData run the following:

git submodule update --remote --merge

Now commit the changes and push.

Hyperopt values to raw values

The strategy uses hyperopt values; this has some compute overhead and thus impact runtime performance with the number of parameters available in the strategy. There is a script available to transform all hyperopt values into raw values. E.g. The following line of code:

buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)

Would be transformed to:

buy_dip_threshold_10_1 = 0.015

Command reference

usage: ho_to_raw_codemod.py [-h] [--strategy STRATEGY] [--output OUTPUT_PATH]

optional arguments:
  -h, --help            show this help message and exit
  --strategy STRATEGY, -s STRATEGY
                        Name of the strategy
  --output OUTPUT_PATH, -o OUTPUT_PATH
                        Output of transformed file

The script has a simple CLI, where it accepts two arguments, the strategy name, and the output file, which is the path of the transformed file. E.g.

python codemods/ho_to_raw_codemod.py --strategy NostalgiaForInfinityNext --output NostalgiaForInfinityNext_Raw.py