You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/lookahead-analysis.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ Many strategies, without the programmer knowing, have fallen prey to lookahead b
38
38
This typically makes the strategy backtest look profitable, sometimes to extremes, but this is not realistic as the strategy is "cheating" by looking at data it would not have in dry or live modes.
39
39
40
40
The reason why strategies can "cheat" is because the freqtrade backtesting process populates the full dataframe including all candle timestamps at the outset.
41
-
If the programmer is not careful or oblivious how things work internally
41
+
If the programmer is not careful or oblivious how things work internally
42
42
(which sometimes can be really hard to find out) then the strategy will look into the future.
43
43
44
44
This command is made to try to verify the validity in the form of the aforementioned lookahead bias.
@@ -50,8 +50,7 @@ After this initial backtest runs, it will look if the `minimum-trade-amount` is
50
50
If this happens, use a wider timerange to get more trades for the analysis, or use a timerange where more trades occur.
51
51
52
52
After setting the baseline it will then do additional backtest runs for every entry and exit separately.
53
-
When these verification backtests complete, it will compare the indicators at the signal candles (both entry or exit)
54
-
and report the bias.
53
+
When these verification backtests complete, it will compare both dataframes (baseline and sliced) for any difference in columns' value and report the bias.
55
54
After all signals have been verified or falsified a result table will be generated for the user to see.
56
55
57
56
### How to find and remove bias? How can I salvage a biased strategy?
@@ -98,8 +97,8 @@ If the strategy has many different signals / signal types, it's up to you to sel
98
97
This would lead to a false-negative, i.e. the strategy will be reported as non-biased.
99
98
-`lookahead-analysis` has access to the same backtesting options and this can introduce problems.
100
99
Please don't use any options like enabling position stacking as this will distort the number of checked signals.
101
-
If you decide to do so, then make doubly sure that you won't ever run out of `max_open_trades` slots,
100
+
If you decide to do so, then make doubly sure that you won't ever run out of `max_open_trades` slots,
102
101
and that you have enough capital in the backtest wallet configuration.
103
-
- In the results table, the `biased_indicators` column
102
+
- In the results table, the `biased_indicators` column
104
103
will falsely flag FreqAI target indicators defined in `set_freqai_targets()` as biased.
105
104
**These are not biased and can safely be ignored.**
0 commit comments