A backtest that uses Friday’s final close to evaluate a signal available on Thursday is invalid evidence. The error is lookahead bias: the test gives the strategy information that a live trader could not have known when deciding.
The problem often appears after a backtest looks unusually clean. A trader reviews the signal log, lines up timestamps, and notices that Thursday’s entry rule pulled a daily value finalized only after Friday’s session. The equity curve still rises on screen. The trade list still shows entries and exits. But the evidence has changed shape. Those trades were never available under the same conditions in which the strategy claims it could have operated.
A fair test starts before the answer is known
At the University of Cambridge in the 1920s, statistician Ronald Fisher faced a smaller version of the same problem. Muriel Bristol said she could tell whether tea or milk had gone into a cup first. Fisher’s test depended on hiding the answer before she made each choice. If the cups had been labeled, arranged predictably, or judged after the fact, a correct result would mean very little.
Fisher later used the experiment in The Design of Experiments to explain why a valid test requires controls set before results are observed. The point was not to make the test difficult. The point was to separate a real ability from an answer that had leaked into the process.
A trading backtest needs that same separation. Your model may use a moving average, a ranking score, an earnings field, a news label, or an AI-generated market summary. Each input needs a timestamp that reflects when it was actually available. If the data was revised later, corrected later, or collected after the market close, the backtest must use the earlier version.
Friday’s close belongs to Friday. A Thursday decision cannot borrow it.
Where future data slips into a backtest
Lookahead bias rarely announces itself. It usually arrives through ordinary research shortcuts.
A common example is calculating an indicator from a completed daily candle, then applying the signal to an entry earlier in that same candle. If the strategy buys at Thursday’s open because Thursday’s closing price ended above a moving average, the test has already seen the day’s finish.
Data revisions create a quieter version of the same problem. Economic data, company fundamentals, index constituents, and some alternative data sets can change after their original release. A backtest built from today’s cleaned data may accidentally give past trades a more complete record than traders had at the time.
Language models add another path. A model trained on internet data may already contain information about events that occurred during a historical test period. Asking it to assess a 2021 setup can produce an answer influenced by what became publicly known later. Research on language models and financial backtesting has warned that this kind of embedded outcome knowledge can undermine a historical test.
The model may sound careful. The output may contain reasonable analysis. Neither fact proves the analysis was available on the date your strategy assigns to it.
Check the clock on every input
Treat every field in a backtest as evidence with a chain of custody. Ask when it was published, when your system could have received it, and whether it was later revised.
Start with a simple audit:
- Record the signal timestamp, the data cutoff timestamp, and the earliest possible order timestamp.
- Use completed bars only when the strategy runs after those bars close.
- Separate original releases from revised data when testing macroeconomic or fundamental inputs.
- Freeze the model version, prompt, and available source material for any AI-assisted research.
- Review a sample of winning trades manually. Trace each input back to what was knowable at that moment.
This work can feel less satisfying than adjusting a parameter until the curve improves. It is also where trust begins. A weaker backtest built from honest timestamps gives you something to investigate. A stronger curve built on future knowledge gives you a false benchmark for risk, position size, and expected drawdown.
Approval creates a useful pause
A queued signal deserves a review before it reaches an order ticket. That review can include the usual questions about entry, invalidation, size, and exposure. It can also ask a more basic question: what did this system know when it produced the signal?
For a strategy under development, keep the answer visible in the trading journal. Note the data cutoff beside the signal. If a backtest used daily close data, document that orders can only be considered after the relevant session closes. If an AI assistant contributed analysis, preserve the version and constraints used for the test.
That discipline matters after losses too. A clean historical curve can make a trader widen risk limits because the strategy appears more reliable than it is. The same care behind a valid test supports the risk rules discussed in Backtesting Overfitting: What Unseen Data Taught Eli About Trusting a Strategy.
Fisher’s tea test only worked because the answer stayed hidden until the choice had been made. Apply that standard to every historical trade. Let the strategy act on the information that existed then, record what happens next, and review the result without editing the past.
Educational content, not financial advice.
Comments
No comments yet.