Skip to main content
Education
Contents
6 min read

Decision time, bar completion, and lookahead

A signal is only valid when every input was knowable before the modeled decision and fill.

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

MomentWhat happensQuestion to ask
ObservationA market or reference event occursWas it recorded with the correct timestamp?
FinalizationA bar, filing, or derived value becomes completeCould this value still change?
DecisionThe complete rule can be evaluatedAre all inputs knowable now?
OrderAn instruction could first be submittedIs there processing or venue delay?
FillThe execution model assigns a transactionDid 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:

TimeWhat it records
Observation periodThe business or market interval the value describes
Publication timeWhen the source released the value
Availability timeWhen the research system could actually use it
Revision timeWhen 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:

  1. the event timestamp carried by the raw observation;
  2. when that observation or bar becomes final;
  3. any calculation window and whether it uses future-centered values;
  4. the exact decision event;
  5. the earliest order-submission event;
  6. the fill event and price rule;
  7. 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