For Business

Backtesting & Statistics

What Is Look-Ahead Bias

Look-ahead bias is a test in which the rule sees, at one bar, something from a later bar, so that its result is not wrong but impossible, because nobody at the screen could have traded it. This paper shows you look-ahead in five lines; the idea as tomorrow's newspaper on today's desk; the plain rule with a cheat added on the euro for 17 to 21 August 2026 on real hourly bars, 77.7 pips against an honest 39.0; one hourly bar as a timeline with the rule standing at its open; and the single character in an Expert Advisor's code on your platform that reads a bar before it has finished.

Difficulty
Intermediate
Reading time
5 min
Pages
8
Reviewed by
Saman Rahbar

This paper is locked

Read it in the browser and keep the PDF with Premium, or buy this one paper.

Look-ahead bias in five lines

Look-ahead bias is a test in which the rule sees, at one bar, something that belongs to a later bar. It creeps in quietly: the close of the bar that is still forming, today's high used at this morning's open, a number that was revised after the day. What it does is make the result not wrong but impossible, because nobody sitting at the screen could have traded it. The way to catch it is to ask, at every decision the rule makes, whether that number had been printed yet, and if not, to throw the test out. The example is the plain rule with a cheat added: buy at 10:00 only on days when the 18:00 price will be higher. On the euro for 17 to 21 August 2026 that made 77.7 pips, where a pip is the fourth decimal place of the price; the honest rule made 39.0.

This paper is locked