Look-Ahead Bias: When a Test Quietly Peeks at the Future
Posted: Sun Oct 04, 2026 11:07 am
Look-Ahead Bias: When a Test Quietly Peeks at the Future
Look-ahead bias occurs when a test uses information that would not have been available at the time of the trade. It is one of the most common reasons backtests look better than reality.
A simple example is using the daily high or low in a rule for an intraday entry. At 10 a.m., you do not know the day's final high, but a test using full-day data does, and the strategy appears to buy near the low consistently.
Another example concerns indicators that repaint. Some custom indicators redraw past signals as new data arrives, so the chart looks perfect in hindsight, though the signal appeared late or differently in real time. Zigzag-type indicators are notorious for it.
Bar timing also causes problems. If a rule triggers at the close of a candle but the test assumes you got the entry at the candle's open, it assumes you acted before the signal existed.
Manual backtesting suffers too, as you know what happens next. Covering the right side of the chart and moving bar by bar helps.
To check, replay the data in real time or on a demo for a few weeks, and compare signals against the historical chart. If they differ, something peeked.
Practical step: test any custom indicator you rely on by saving a screenshot of its signals live, then comparing them with the chart a day later.
Look-ahead bias occurs when a test uses information that would not have been available at the time of the trade. It is one of the most common reasons backtests look better than reality.
A simple example is using the daily high or low in a rule for an intraday entry. At 10 a.m., you do not know the day's final high, but a test using full-day data does, and the strategy appears to buy near the low consistently.
Another example concerns indicators that repaint. Some custom indicators redraw past signals as new data arrives, so the chart looks perfect in hindsight, though the signal appeared late or differently in real time. Zigzag-type indicators are notorious for it.
Bar timing also causes problems. If a rule triggers at the close of a candle but the test assumes you got the entry at the candle's open, it assumes you acted before the signal existed.
Manual backtesting suffers too, as you know what happens next. Covering the right side of the chart and moving bar by bar helps.
To check, replay the data in real time or on a demo for a few weeks, and compare signals against the historical chart. If they differ, something peeked.
Practical step: test any custom indicator you rely on by saving a screenshot of its signals live, then comparing them with the chart a day later.