Look-Ahead Bias

Glossary · Quant & Stats

Look-ahead bias is a backtest using information that was not available at the moment the decision was made — a candle's close before the candle finished, a revised data point, a level drawn with hindsight. It produces results that could never have been traded live, and it is the most common reason a beautiful backtest fails in production.

"If the rule knew where the candle closed before it closed, it is not a strategy, it is a time machine — and the exchange does not accept those."

The classic case: a rule that acts 'when RSI crosses 30' evaluated on the closed candle, then the entry priced at that candle's open — you traded before you knew. Or resolving a setup against a candle that was still forming. Or using the day's high in a rule that runs at the day's open. Our pattern backtests detect on closed candles and enter at the next open for exactly this reason, and the setups resolver never judges a forming candle for a stop.

How to catch it: for every rule, write down the timestamp at which each input was known and the timestamp at which the trade would have been placed; if any input's timestamp is later, the test is contaminated. Data revisions are subtler — a market-cap rank recomputed later is not the rank the rule would have seen. Paper-trade the rule forward for a month and compare; a large gap is the bias showing itself.

Pattern backtests: closed candles, entry at the next open

Related jargon

Questions

What is Look-Ahead Bias in crypto trading?
Look-ahead bias is a backtest using information that was not available at the moment the decision was made — a candle's close before the candle finished, a revised data point, a level drawn with hindsight. It produces results that could never have been traded live, and it is the most common reason a beautiful backtest fails in production.
How would a trader say it?
If the rule knew where the candle closed before it closed, it is not a strategy, it is a time machine — and the exchange does not accept those.

Part of the Crypto Jargon glossary — every term, decoded the way a trader would say it.

Crypto Jargon

Live numbers load with JavaScript and refresh every few minutes; the text above is the page at build time.