Skip to content

Commit

Permalink
Merge pull request #1864 from freqtrade/doc/backtest_future
Browse files Browse the repository at this point in the history
Improve documentation to point out usage of future data during backtesting
  • Loading branch information
mishaker committed May 19, 2019
2 parents 2463f02 + fc96da8 commit 46b347b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/bot-usage.md
Expand Up @@ -103,7 +103,7 @@ If the bot does not find your strategy file, it will display in an error
message the reason (File not found, or errors in your code).

Learn more about strategy file in
[optimize your bot](bot-optimization.md).
[Strategy Customization](strategy-customization.md).

### How to use **--strategy-path**?

Expand Down Expand Up @@ -296,4 +296,4 @@ in [misc.py](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/misc.
## Next step

The optimal strategy of the bot will change with time depending of the market trends. The next step is to
[optimize your bot](bot-optimization.md).
[Strategy Customization](strategy-customization.md).
6 changes: 6 additions & 0 deletions docs/bot-optimization.md → docs/strategy-customization.md
Expand Up @@ -53,6 +53,12 @@ file as reference.**
It is therefore best to use vectorized operations (across the whole dataframe, not loops) and
avoid index referencing (`df.iloc[-1]`), but instead use `df.shift()` to get to the previous candle.

!!! Warning Using future data
Since backtesting passes the full time interval to the `populate_*()` methods, the strategy author
needs to take care to avoid having the strategy utilize data from the future.
Samples for usage of future data are `dataframe.shift(-1)`, `dataframe.resample("1h")` (this uses the left border of the interval, so moves data from an hour to the start of the hour).
They all use data which is not available during regular operations, so these strategies will perform well during backtesting, but will fail / perform badly in dry-runs.

### Customize Indicators

Buy and sell strategies need indicators. You can add more indicators by extending the list contained in the method `populate_indicators()` from your strategy file.
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Expand Up @@ -3,7 +3,7 @@ nav:
- About: index.md
- Installation: installation.md
- Configuration: configuration.md
- Custom Strategy: bot-optimization.md
- Strategy Customization: strategy-customization.md
- Stoploss: stoploss.md
- Start the bot: bot-usage.md
- Control the bot:
Expand Down

0 comments on commit 46b347b

Please sign in to comment.