Look-Ahead Bias

Definition

Look-ahead bias occurs when a backtest uses information that would not have been available at the simulated decision time, such as a price, report or revision published later. It inflates results because the test knows something the real decision-maker could not.

How it works

Common sources include trading at a bar's close using a signal that needs that same close, using financial figures on their period-end date rather than their publication date, using restated rather than originally reported data, and standardizing signals with statistics from the whole sample.

Prevention starts with timestamps: record when each data point became public, execute signals no earlier than the next bar or the next available price, and use point-in-time databases. A rule whose result changes sharply when its signal is delayed by one period deserves suspicion.

Illustrative example

Illustrative: a fictional company's fiscal year ends on December 31, 2022, but its full-year profit is published on March 28, 2023, 87 days later. A backtest that ranks stocks on December 31, 2022 using that profit relies on a number the market did not have for another 87 days, so the rule should act on it only from March 28, 2023 onward, at the next available price.

What to watch for

Look-ahead bias is often subtle and can produce extraordinary-looking results that vanish in live use. Take particular care with restated or adjusted data, index membership known only today, and parameters chosen using the whole dataset.