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
+5-9Lines changed: 5 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,17 +29,15 @@ These are set to avoid users accidentally generating false positives.
29
29
30
30
--8<-- "commands/lookahead-analysis.md"
31
31
32
-
!!! Note ""
32
+
!!! Note
33
33
The above output was reduced to options that `lookahead-analysis` adds on top of regular backtesting commands.
34
34
35
35
### Introduction
36
36
37
37
Many strategies, without the programmer knowing, have fallen prey to lookahead bias.
38
-
This typically makes the strategy backtest look profitable, sometimes to extremes,
39
-
but this is not realistic as the strategy is "cheating" by looking at data it would not have in dry or live modes.
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.
40
39
41
-
The reason why strategies can "cheat" is
42
-
because the freqtrade backtesting process populates the full dataframe including all candle timestamps at the outset.
40
+
The reason why strategies can "cheat" is because the freqtrade backtesting process populates the full dataframe including all candle timestamps at the outset.
43
41
If the programmer is not careful or oblivious how things work internally
44
42
(which sometimes can be really hard to find out) then the strategy will look into the future.
45
43
@@ -48,8 +46,7 @@ This command is made to try to verify the validity in the form of the aforementi
48
46
### How does the command work?
49
47
50
48
It will start with a backtest of all pairs to generate a baseline for indicators and entries/exits.
51
-
After this initial backtest runs,
52
-
it will look if the `minimum-trade-amount` is met and if not cancel the lookahead-analysis for this strategy.
49
+
After this initial backtest runs, it will look if the `minimum-trade-amount` is met and if not cancel the lookahead-analysis for this strategy.
53
50
If this happens, use a wider timerange to get more trades for the analysis, or use a timerange where more trades occur.
54
51
55
52
After setting the baseline it will then do additional backtest runs for every entry and exit separately.
@@ -97,8 +94,7 @@ especially if your entry and exit conditions use the same biased indicator.
97
94
### Caveats
98
95
99
96
-`lookahead-analysis` can only verify / falsify the trades it calculated and verified.
100
-
If the strategy has many different signals / signal types, it's up to you to select appropriate parameters
101
-
to ensure that all signals have triggered at least once. Signals that are not triggered will not have been verified.
97
+
If the strategy has many different signals / signal types, it's up to you to select appropriate parameters to ensure that all signals have triggered at least once. Signals that are not triggered will not have been verified.
102
98
This would lead to a false-negative, i.e. the strategy will be reported as non-biased.
103
99
-`lookahead-analysis` has access to the same backtesting options and this can introduce problems.
104
100
Please don't use any options like enabling position stacking as this will distort the number of checked signals.
0 commit comments