Look-ahead bias: the quietest way to fool yourself
Most backtests that look too good are quietly using information that did not exist yet. How we keep every test honest about time.
A backtest is a story about the past told with hindsight. The danger is that hindsight leaks into the story. When a test uses a piece of information before it was actually available, the results look better than anything that could have been traded, and nothing in the output warns you. There is no error message for look-ahead bias. That is what makes it the quietest way to fool yourself.
1. Know when you knew it
Every piece of data has two dates: the moment it describes and the moment it became known. A company’s quarterly results describe a quarter that ended weeks before they were published. A headline describes an event, but a trader could only act on it once it crossed the wire. Economic releases are often revised months later, and the revised number is not the one anyone saw on the day.
So we store and test on point-in-time data: each record carries the time it became available, news is stamped with its publication time, and economic data is tested on the first figure released, not the corrected one. A rule may only use what was known at the moment it makes its decision.
2. The universe changes too
Testing a rule on today’s list of stocks quietly removes every company that was delisted, merged away or went bankrupt along the way. The survivors look better than the market that actually existed. We rebuild the tradable universe as it stood on each date and keep the names that later disappeared. Splits, dividends and other corporate actions are applied only from the point they were announced.
3. A bar is not finished until it closes
Price data comes in bars: a minute, an hour, a day. A subtle leak is to let a rule react to a bar’s close, high or low while that bar is still forming. Our indicators are built only from bars that had closed by the moment of each decision, and entries are assumed to happen after the signal, not at the price that created it. When a test cannot tell whether a stop or a target was reached first inside a single bar, we assume the worse outcome.
4. Make the honest way the easy way
Good intentions are not enough; the discipline has to live in the tools. Our research platform keeps the time each piece of information arrived and replays history on that clock, so building a test the honest way is the default rather than an extra step. When a result looks surprisingly good, the first question we ask is not “why does this work?” but “what did this rule know that it should not have?”
Removing look-ahead bias almost always makes results worse. That is the point. A smaller, honest edge is worth more than a large one that only exists in hindsight.
This note describes research methods. It is not investment advice and does not describe the performance of any account or fund.