A decision can use only what was known
Decision time is the first moment when every input needed by a strategy is complete and observable. Execution time is the later moment when the resulting order could interact with the market. Keeping those two moments separate is one of the most important habits in backtesting.
Consider a rule that uses today’s closing price. The final close is not known throughout the day; it is the value produced when the bar completes. If that close is needed to calculate a signal, the strategy cannot also assume it entered at the same close unless it models a real order process whose cutoff occurred before the signal was final. Most daily research should make the decision after the bar and model the first eligible execution afterward.
Lookahead bias occurs whenever a historical decision receives information earlier than it was available in reality. Sometimes the error is obvious, such as using tomorrow’s return. More often it is hidden in timestamps, revised fundamentals, centered indicators, swing points confirmed by later bars, or a fill price taken from the event that completed the signal.
Five moments to keep distinct
| Moment | What happens | Question to ask |
|---|---|---|
| Observation | A market or reference event occurs | Was it recorded with the correct timestamp? |
| Finalization | A bar, filing, or derived value becomes complete | Could this value still change? |
| Decision | The complete rule can be evaluated | Are all inputs knowable now? |
| Order | An instruction could first be submitted | Is there processing or venue delay? |
| Fill | The execution model assigns a transaction | Did an eligible later event support that price? |
The gaps may be milliseconds or months. The logic is the same for a depth signal, a daily moving average, and a quarterly accounting factor.
The fill can occur at the same named price as the observation without being lookahead only when the order process makes that possible. For example, an order submitted before a closing auction may receive the official close, but a signal that requires the final closing price was not complete before that submission cutoff. The honest question is not whether two fields both say “close.” It is whether the information existed before the order became eligible.
A completed-bar example
Illustrative example. Assume a five-minute rule enters long when the close crosses above a channel. The 10:00–10:05 bar has a final close of 101 and a channel boundary of 100.80. The crossing is not established at 10:03 merely because the developing bar is temporarily above the boundary. It becomes a completed-bar fact at 10:05.
A clean baseline evaluates the rule after 10:05 and uses the next eligible event for execution. An event-driven design could react to an intrabar crossing, but then it is a different rule using event-level inputs and a different definition of confirmation. It should not borrow the completed bar’s final high, low, close, or volume while claiming to have acted earlier.
The same distinction affects exits. A stop based on a fixed price known at entry may trigger intrabar. An exit based on a recalculated closing indicator cannot be evaluated until the indicator’s decision event is complete.
Publication time is part of the data
Fundamental and economic values have at least three relevant dates: the period they describe, the date they were released, and the dates of later revisions. A company’s annual revenue may describe a fiscal year ending in December but become public weeks later. A revised macroeconomic estimate may not have existed for months.
Assigning the value to its period end gives the strategy knowledge it did not have. Replacing every historical release with the latest revision creates a cleaner series that no historical researcher could have observed. Point-in-time research preserves release timestamps and a declared revision policy.
A timestamp also needs a meaning. Four times can differ:
| Time | What it records |
|---|---|
| Observation period | The business or market interval the value describes |
| Publication time | When the source released the value |
| Availability time | When the research system could actually use it |
| Revision time | When a replacement value became available |
A database row stamped with the observation period is not evidence that the value was available then. Likewise, assigning every release to its scheduled publication minute can still be optimistic if the strategy depends on a feed, processing step, or cross-market alignment that arrives later. Point-in-time research needs the earliest defensible availability time, not merely the most convenient date field.
Cross-sectional timing has another trap
A rank across many instruments is knowable only when the eligible universe and all required inputs are simultaneously defined. If one market closes earlier, one filing arrives later, or stale observations are filled forward, the rank may compare information from different effective times.
Declare a common decision cutoff. Exclude, delay, or explicitly age observations that were unavailable at that cutoff. Otherwise the portfolio may be using the future merely by sorting asynchronous data as if it were synchronous.
Lookahead can enter through research choices
Even perfectly aligned rows can support a biased experiment if the rules were chosen after studying the evaluation period. Selecting a channel length because it avoided a known crash is not timestamp leakage inside the calculation, but it still gives the design knowledge of the future.
This is why timing discipline and out-of-sample discipline complement each other. The first prevents impossible information inside a run. The second asks whether the researcher’s decisions survive data not used to make them.
A practical timing audit
For every input and action, write down:
- the event timestamp carried by the raw observation;
- when that observation or bar becomes final;
- any calculation window and whether it uses future-centered values;
- the exact decision event;
- the earliest order-submission event;
- the fill event and price rule;
- the time zone, session calendar, and daylight-saving policy.
If any step cannot be stated, the result may be reproducible in software while remaining impossible in the market.
Common timing mistakes
- Filling at the close that finalized a close-based signal.
- Backdating a pivot to the pivot bar when later bars were needed to confirm it.
- Using a day’s final high, low, or volume in an intraday decision.
- Ranking securities with filings that were not all public at the cutoff.
- Forward-filling a fundamental value before its publication time.
- Applying a later restatement to the whole historical series.
- Calculating a feature over the full sample before creating the train/test split.
Further reading
- Croushore and Stark, “A Real-Time Data Set for Macroeconomists” (2001) — Demonstrates how using revised data instead of the vintage available at decision time can materially change a historical evaluation.
- Tashman, “Out-of-Sample Tests of Forecasting Accuracy: An Analysis and Review” (2000) — Makes estimation, forecast origin, evaluation window, and later observation explicit, supporting the guide’s ordered-information discipline.
- Perold, “The Implementation Shortfall: Paper Versus Reality” (1988) — Anchors a decision to the information and reference price available when it was made, before later execution outcomes become known.