Look-ahead bias is using information in a backtest that wasn't available at the moment of the trade. It's the most common way backtests become impossible to reproduce live, and it can be subtle.
Common sources
- Same-bar fills: a signal needs the bar's close, and the test fills at that close (or worse, at the bar's best price).
- Future-confirmed points: swing highs and lows confirmed by later bars, used as if known at the time.
- Daily values used intraday: using today's high, low or close in a rule that trades during today.
- Indicators that repaint: some indicators change past values as new data arrives.
- Revised data: economic numbers later revised, used in their final form.
- Settlement versus last trade: using the official settlement price in a rule that would need to act before it's published.
Example (hypothetical)
Rule: "Buy at the day's low when the day closes up." This uses the day's low and close, which are only known after the day ends. In a backtest it looks spectacular; live it is impossible.
How to find it
- For every input in every rule, ask: at what exact moment was this known?
- Check that each fill happens after that moment, at a price that was actually available then.
- Run the strategy on data fed bar by bar, as it would arrive live, and compare with the batch backtest. Any difference points to look-ahead.
Why it matters so much
Look-ahead bias doesn't make a backtest a bit optimistic; it can make a worthless strategy look excellent. Regulators require simulated results to warn about the benefit of hindsight for this reason.
Takeaways
- Look-ahead bias uses information not yet available at the time of the trade.
- Common sources: same-bar fills, future-confirmed swings, daily values intraday, repainting indicators.
- For every input, ask exactly when it was known.
Common misconceptions
- "My platform's backtester prevents it." Some do partly; rules can still use future information.
- "A little look-ahead doesn't matter." It can turn a losing strategy into an apparent winner.