Look-Ahead Bias: What It Is Worth, Measured by Injecting It

Written by chwoo · Crypto trader, 7 years. Running an automated futures bot since spring 2026. · · updated

Look-ahead bias is using information in a backtest that would not have existed yet at that moment. It is the most dangerous flaw a backtest can have, because it does not produce an error. It produces a beautiful equity curve.

Rather than list the ways it happens, we injected it. The engine on this site fills the bar afterthe signal, at that bar's open, which is honest. For this article we deliberately rewrote the candle data so the engine would fill at prices it could not have known, and measured what each lie is worth.

What each cheat is worth

Three strategies on BTC hourly candles, realistic costs (0.06% fee and 0.02% slippage per side), 1x leverage, 90% position size, data through 21 September 2026. Only the assumed fill price changes.

Strategy and fill assumptionTradesWin rateReturnMax drawdown
RSI 30 — next bar open (honest)69938.3%-79.2%85.2%
RSI 30 — signal bar close69938.3%-79.2%85.2%
RSI 30 — signal bar low62860.8%+13,596.4%15.9%
Bollinger — next bar open (honest)1,17840.1%-82.6%88.5%
Bollinger — signal bar close1,17840.1%-82.6%88.5%
Bollinger — signal bar low1,13949.8%+2,526.2%26.9%
MACD — next bar open (honest)2,57332.4%-70.2%92.3%
MACD — signal bar close2,57332.4%-70.3%92.3%
MACD — signal bar low2,57343.0%+657,482.9%26.3%
Same rules, same data, three fill assumptions. Every strategy that loses honestly becomes spectacular on the optimistic fill.

Open the strategy this guide measures in the backtester →

All three strategies flip from losing to winningonce the fill is moved to the signal bar's low, and the MACD one returns 657,482.9%, a number that should be read as an error message rather than a result. Nobody would publish that figure believing it. The point is what accompanies it.

Look at the drawdown column. Honest MACD has a 92.3% drawdown; the cheating version has 26.3%. And the win rate climbs from 32.4% to 43.0%. Look-ahead does not only inflate the return, it makes every other statistic look healthy at the same time. That is why it survives review: a curve with a 26% drawdown and a 43% win rate does not look like a bug.

The mistake everyone warns about is nearly harmless here

Now the surprise. The middle row of each group is the classic error: computing an indicator from a candle's close and then assuming you bought at that same close. Every backtesting tutorial warns about it. In our measurement it changed the result by at most 0.1 percentage points across all three strategies.

The reason is structural. Crypto trades 24 hours a day with no session break, so one bar's close and the next bar's open are almost the same number. There is no overnight gap for the bias to live in. On stocks, where a close and the next open can be several percent apart, this same mistake is genuinely dangerous.

This is worth stating plainly because the received advice is imported from equities and repeated in crypto without being checked. Close-versus-open fill is not where your crypto backtest is lying to you. It is still correct to fill on the next bar, and this site does, but fixing that alone does not make a backtest honest.

Where the damage actually scales

The optimistic fill again, on the same RSI rule, across four timeframes.

TimeframeHonestSignal bar closeSignal bar lowInflation
15 minutes-91.9%-92.1%+172,130.8%172,222.7pp
1 hour-79.2%-79.2%+13,596.4%13,675.6pp
4 hours-41.9%-41.9%+1,988.3%2,030.2pp
1 day-13.1%-13.1%+78.0%91.1pp
The inflation is largest on the smallest timeframe, even though a 15-minute bar has the smallest range.

The direction here is the opposite of the intuition. A daily candle has a far wider range than a 15-minute candle, so you would expect the daily cheat to be worth more. It is worth 91.1 points against 172,222.7.

The explanation is compounding, not bar size. A tiny fake advantage per trade, repeated across the 15-minute strategy's far larger trade count, multiplies into an absurd total. Look-ahead is most dangerous exactly where strategies trade most, which is also where beginners tend to start.

The ambiguity we cannot measure away

One case has no clean answer. If a candle's high reaches your take profit and its low reaches your stop, OHLC data cannot say which came first. A backtest must choose, and choosing the favourable one is look-ahead by another name.

This engine always resolves that candle as the stop, the pessimistic reading. It makes results slightly worse than reality on average, and we prefer that direction of error. A tool that resolved it the other way would show better numbers on exactly the volatile candles where real fills are worst.

How to check a backtest for this

  • Distrust a high win rate paired with a low drawdown.In the first table, cheating moved MACD's drawdown from 92.3% to 26.3% while raising its win rate. That combination is the signature.
  • Ask which bar the fill happens on. The answer should be the bar after the signal. In crypto this matters less than you were told, but a tool that cannot answer the question has other problems.
  • Ask how same-bar take-profit and stop collisions resolve. If the answer is the favourable one, or there is no answer, the results are optimistic by an unknown amount.
  • Be most suspicious of high-frequency results. The timeframe table shows the bias compounding hardest where trades are most numerous.
  • Check that indicators only use closed bars. A repainting indicator that revises its own past values will pass every other check on this list.

This site's engine is verified against an independently written Python implementation, trade for trade, which is how we know the honest column above is actually honest. That cross-check is described in the methodology page.

If a backtest shows a return that seems impossible, it usually is, and the cause is usually this. The strategies in the first table lose 70% to 83% when run correctly. The same rules, with one price assumption changed, return thousands of percent with a quarter of the drawdown and a better win rate. Nothing else about them changed.

References

Reading is good. Testing is better. Run a real backtest on 7 years of Binance data, free.

Try the backtester