lesson 2 of 5
Lookahead bias
Lookahead bias happens when a backtest uses information that would not have been available at the moment a decision was made. It is the single most common reason a strategy looks far better in testing than it can ever be in real trading.
Common forms
- Using a candle's close to make a decision during that candle.
- Treating a pattern as confirmed before its last candle has closed, for example a fair value gap before the third candle completes.
- Using a session's final high, low or VWAP to judge a trade taken earlier in the session.
- Using indicators calculated on data that includes future bars.
- Using a list of contracts or instruments that only exists because of what happened later.
How to guard against it
Every rule should be written in terms of what had already happened at the moment of the decision. Ask, for each condition: at the exact time this trade would be entered, could I have known this? If the answer is 'only afterwards', the rule has a lookahead problem.
Results that look too smooth, or entries that seem to catch turns perfectly, are a warning sign worth investigating.
Educational content only. Not financial advice.