Page 1 of 1

Look-ahead bias in M1 tests

Posted: Sat Oct 31, 2026 4:08 am
by Shadow Trader
Look-ahead bias happens when a test uses information that wasn't available at the time of the decision. In daily-bar systems it's easy to avoid. In very short-term tests, it sneaks in more subtly.

A common case: a signal computed from the close of a one-minute bar is used to enter at the open of the same bar. The close wasn't known yet. The test appears to buy at the exact start of a move.

Another: an indicator that uses the high or low of the current bar to define a level, and the test enters at that level during the same bar. If the high is only known at the end of the bar, the entry came from the future.

Resampling data also causes it. Building higher timeframe bars from lower ones and aligning them wrongly means a 15-minute bar's close is visible at the start of the 15 minutes.

Results from look-ahead are often too good to be true: smooth equity curves, win rates above 80 percent, very few losing trades. That's a red flag.

A practical test is to shift all signals by one bar and see how the results change. If the profits vanish, the strategy depended on information that wasn't available.

A quick audit of a test script helps: for every value the signal uses, ask when it became known. The close of the current bar becomes known only after the bar ends. A daily high becomes known only after the day ends. Any signal that reads these values early is peeking.

What is the typical sign that a test has a hidden look-ahead problem?

Re: Look-ahead bias in M1 tests

Posted: Sat Oct 31, 2026 5:09 am
by Amanhasnoname
The tell for me has always been the equity curve looking too calm. The first time I fell into this I had a breakout test on one minute bars that bought when price exceeded the bar's own high, and it showed almost no losing days for three months of data. I was genuinely excited for about an evening.

The bug was exactly the one you describe. The script knew the high of the current bar before the bar was finished, so every entry was effectively placed with knowledge of where the bar would top out. Once I forced it to use only the previous completed bar, the win rate dropped from the high seventies to the mid forties and the profit disappeared.

Now I always run the one bar shift you mention as a standard step. I also print a handful of trades with timestamps and check them by hand against the chart, because reading five trades slowly catches things a summary table hides.