From 8d8b4a69b759c0774e913abc26c82105c18d6f3c Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 19 May 2019 09:03:56 +0200 Subject: [PATCH 1/3] Clearly warn about using future data during strategy development --- docs/bot-optimization.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/bot-optimization.md b/docs/bot-optimization.md index 5e080eab1..97166a736 100644 --- a/docs/bot-optimization.md +++ b/docs/bot-optimization.md @@ -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 dry-run tests. + ### 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. From f93e6ad0f6461fee649cfaeeed2f2400ada8d0e1 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 19 May 2019 09:07:43 +0200 Subject: [PATCH 2/3] Rename strategy customization file --- docs/bot-usage.md | 4 ++-- docs/{bot-optimization.md => strategy-customization.md} | 0 mkdocs.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename docs/{bot-optimization.md => strategy-customization.md} (100%) diff --git a/docs/bot-usage.md b/docs/bot-usage.md index 2b2fef640..cb98e1ea5 100644 --- a/docs/bot-usage.md +++ b/docs/bot-usage.md @@ -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**? @@ -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). diff --git a/docs/bot-optimization.md b/docs/strategy-customization.md similarity index 100% rename from docs/bot-optimization.md rename to docs/strategy-customization.md diff --git a/mkdocs.yml b/mkdocs.yml index ecac265c1..9932ff316 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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: From fc96da869a4d0b5051eefd8e437b088dc35cf941 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 19 May 2019 16:07:16 +0200 Subject: [PATCH 3/3] Fix grammar messup --- docs/strategy-customization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index 97166a736..51540f690 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -57,7 +57,7 @@ file as reference.** 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 dry-run tests. + 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