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 assumption | Trades | Win rate | Return | Max drawdown |
|---|---|---|---|---|
| RSI 30 — next bar open (honest) | 699 | 38.3% | -79.2% | 85.2% |
| RSI 30 — signal bar close | 699 | 38.3% | -79.2% | 85.2% |
| RSI 30 — signal bar low | 628 | 60.8% | +13,596.4% | 15.9% |
| Bollinger — next bar open (honest) | 1,178 | 40.1% | -82.6% | 88.5% |
| Bollinger — signal bar close | 1,178 | 40.1% | -82.6% | 88.5% |
| Bollinger — signal bar low | 1,139 | 49.8% | +2,526.2% | 26.9% |
| MACD — next bar open (honest) | 2,573 | 32.4% | -70.2% | 92.3% |
| MACD — signal bar close | 2,573 | 32.4% | -70.3% | 92.3% |
| MACD — signal bar low | 2,573 | 43.0% | +657,482.9% | 26.3% |
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.
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.
| Timeframe | Honest | Signal bar close | Signal bar low | Inflation |
|---|---|---|---|---|
| 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 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.
References
- Binance public market data (data.binance.vision) — The candle archive every number on this site is computed from.
- Binance klines endpoint — The raw response shows the open time, close time and close price a candle is only final at.