Risk & Performance Metrics Intermediate

Look-Ahead Bias

Also known as: lookahead bias, future leak, peeking bias, forward-looking bias

What is it?

Look-ahead bias is a backtest error in which the strategy acts on information that did not exist yet at the moment it acted. It rarely arrives as an obvious mistake. The classic version is a rule such as buy at today's open when today closes above the 50-period moving average - unrunnable, because the close is hours in the future when the open prints.

Side by side
Entry on the open of the bar whose close confirms
  • Win rate: 87%
  • Profit factor: 4.1
  • Max drawdown: 3%
  • Equity curve: an almost straight line
  • Uses a price that had not printed when it decided
Same rules, entry moved to the next bar's open
  • Win rate: 51%
  • Profit factor: 1.06
  • Max drawdown: 19%
  • Equity curve: choppy and barely rising
  • Uses only prices available at decision time
Not one rule changed between these columns - only when the strategy was allowed to know the close. Illustrative figures.

Subtler versions do the same thing quietly: using a daily high or low to decide an intrabar entry, backtesting against restated fundamental data that was revised weeks later, or trusting an indicator that repaints and therefore shows the value it settled on rather than the value it displayed at the time. The signature is results that are too clean. A leaked future value typically produces a near-straight equity curve, a win rate above 80% and a drawdown of a few percent, because the strategy is effectively being told the answer before it decides.

It is worth separating from overfitting: an overfitted strategy fits noise that genuinely existed in the data, while look-ahead bias uses data that had not happened yet. Overfitting produces an edge that was never repeatable; look-ahead produces an edge that was never available.

Why it matters: A backtest that uses a bar's close to trade that same bar is reading the future, which is why its equity curve comes out too clean to be real.

Trade impact: Critical

A single leaked future value can turn a losing strategy into a flawless backtest, and nothing in the results themselves reveals the error.

Real-world example

A crossover system that entered at the open of the very bar whose close confirmed the cross backtested at an 87% win rate; moving the entry to the next bar's open dropped it to 51%.

How SignalBots handles it

SignalBots signals fire only on confirmed, closed bars and are timestamped in UTC at the moment they are sent, so a published entry is one that was genuinely available then. See /risk-warning.

Pro tip

Re-run any suspiciously good backtest with every entry delayed by one full bar. If the edge disappears, the original was trading on data it could not have had.

Common pitfalls

Trusting a repainting indicator, whose historical line shows the value it finally settled on rather than what it displayed while the bar was still forming.

FAQs

Frequently asked questions

How do I detect look-ahead bias in my own backtest?

Shift every entry one bar later and compare. A genuine edge degrades a little; a leaked future value collapses the whole result, because the strategy has lost the information it was secretly relying on.

Is look-ahead bias the same as overfitting?

No. Overfitting tunes the rules to noise that really existed in the sample, while look-ahead uses information that had not happened yet at decision time. A strategy can suffer from both at once.

Can a backtesting platform introduce it for me?

Yes, quite easily. Bar-based engines have to guess whether a bar's high or low came first, so a trade whose stop and target both sit inside one bar may be resolved in the strategy's favour unless the engine is set to assume the worst case.

Does it affect live trading too?

Not directly, because live trading cannot access data that does not exist. The damage is that the backtest promised a result the live system was never able to produce, so position sizing and expectations were built on a number that was never real.

Why does a repainting indicator cause look-ahead bias?

Because its historical values are recalculated once later bars arrive. When you test against that history you are reading a line drawn with hindsight, not the line a trader would have seen while deciding.

Trading involves substantial risk of loss. Historical and backtested results do not guarantee future performance. Read the full risk warning.

Add SignalBots as a preferred source on Google Add SignalBots as a preferred source on Google