Skip to content
Quantintermediate
SAME-BAR SIGNAL AND FILLTOO-SMOOTH CURVE
FILL ON THE NEXT BARTIMESTAMP EVERY INPUT

Look-Ahead Bias

A backtest error where the simulation uses information that would not have been available at the moment of the trade — producing results no live trader could reproduce.

Also called Lookahead Bias · Data Leakage · Future Leak

Look-ahead bias creeps in whenever a backtest lets a decision depend on data from the future. The classic case is entering at today's close using a signal calculated from today's close: in real time the bar is not finished when the order must be sent. Other sources are indicators that repaint, fundamental data stamped with its period end rather than its publication date, and index membership lists taken from today instead of from each historical date.

The symptom is a backtest that looks too smooth — a very high win rate, a tiny drawdown, entries that land near exact turning points. The fix is discipline about timestamps: a signal computed on bar t can only be acted on at bar t + 1, and every input must be stamped with the moment it actually became known.

On the desk

A rule buys at the close when the close is above the 20-day high. Backtested as written, it shows a 68% win rate. Shifted so the order fills at the next bar's open, the win rate falls to 46% — the 22-point gap was entirely information from the future.

Related terms