What is look-ahead bias
Look-ahead bias is an error in a backtest where the strategy uses information that would not have been available at the moment the trade decision was made.
A backtest is a simulation of a trading rule on past prices. Its results are only meaningful if every decision in it uses data that existed at that point in time. When future data leaks in, the test looks much better than any live result could be.
Formally, a decision made at time t may use only the information set available up to t. Any input that is published, revised, completed or confirmed after t introduces look-ahead bias.
Ready to try it on a real or demo account?
Partner link · trading carries a high risk of loss
Look-ahead bias example
This is a hypothetical case.
A tester writes the rule: "Buy at the day's open if the day closes above its moving average." The code checks the close of the current daily bar and then enters at the open of that same bar.
In real trading, the close is not known until the day ends, so the entry at the open could never have happened. The backtest still "knows" how the day ended, so it buys mostly on days that rose. The equity curve climbs almost smoothly, and the annualized return looks unusually high.
The fix is to base the signal on the previous bar's close and enter at the next bar's open. The same rule then usually shows far weaker results. Those weaker results are the realistic ones.
Edge cases experienced testers check
- Bar timing. Using a bar's high, low or close to decide an entry inside that bar. Intrabar fills need tick data or conservative assumptions.
- Higher-timeframe data on lower timeframes. Pulling the daily high into intraday bars before the day is finished.
- Repainting indicators. Zigzag, fractals and some pivot tools change past values once later bars arrive. A pattern confirmed later must not trigger an earlier trade.
- Revised economic data. GDP, inflation and employment figures are often revised. A test should use the value as first published ("vintage" or point-in-time data), not the final revised figure.
- Release time vs reference period. A monthly figure covers a past month but becomes public later. Signals must start only from the release time.
- Full-sample statistics. Normalising data with a mean or volatility calculated over the whole history leaks future information into early bars.
- Adjusted prices and index membership. Back-adjusted prices and today's index constituents can reflect events that came later. The second problem is usually called survivorship bias.
- Parameter selection. Choosing settings after seeing the whole period is related overfitting (data snooping). It is not the same error, but it often appears alongside look-ahead bias.
Where the term appears
- Platform testers. Strategy testers in MetaTrader and other platforms do not flag look-ahead bias. The tester's code and data choices decide whether it exists.
- Research and backtest reports. Quant papers and strategy reviews name it as a reason why a published result may not hold live.
- News and vendor claims. Marketed systems with near-perfect historical records are often criticised for it.
- Automated systems. In API trading, the same leak can come from timestamps, time zones or data feeds that deliver revised values.
A clean backtest does not predict future results. Leveraged CFD and forex trading can lose money fast, including with a well-tested rule. See risk management.
Related terms
- Equity curve
- Annualized return
- Fat tails and tail risk
- Technical analysis
- Trading strategies
- Trading glossary
Frequent questions
What does look-ahead bias mean in simple words?
The backtest used information from the future, which a real trader could not have had at that moment.
How do I spot look-ahead bias in backtesting?
Check that every signal uses only completed bars and data already published. Then shift entries to the next bar and see whether the results collapse.
Is look-ahead bias the same as overfitting?
No. Look-ahead bias leaks future data into a decision. Overfitting tunes a rule too closely to past noise. Both make results look better than they are.
Can a demo account show look-ahead bias?
No. A demo account runs forward in real time, so future data is not available to it. That makes demo trading a useful check on a backtest. See the demo account page.
