VALIDATION / LEARN

Lookahead bias: when a test knows the future

How information reaches a signal too early and which questions can reveal the error.

DEFINITION

Lookahead bias occurs when a simulated decision uses information unavailable at the decision time. It can make a test look better than the executable workflow would have been.

Timing before formula

A correct formula can still use the wrong data. For every signal, ask when each input became available. Multi-timeframe logic can confuse the current and completed values of a higher-timeframe bar.

A retrospective explanation is not enough

A signal matching a historical high perfectly may not have been visible then. Record signal time and the data state used. Replay evaluation step by step instead of looking only at the completed chart.

AI-generated code needs the same review

Readable code that compiles can still leak information. Ask for the availability timing of every data source, then check the explanation independently. A good prompt or plausible rationale is not validation evidence.

A practical example

Thought experiment: a system decides at 10:05 but already uses the final high of the 10:00–11:00 hour. That high is known only later. The test is using a different information set from the one available at 10:05.

For your next test

  • Document availability of every signal input.
  • Review multi-timeframe logic and bar closing carefully.
  • Compare historical and new signals with timestamps.

Common question

Is all repainting lookahead bias?

No. Values changing during an open bar can be normal. The key is which value is used for an executable decision.

Sources & further reading

Educational content, not investment advice. Numerical examples are hypothetical, not results of a REVENQOR system.

Continue learning

Recognize overfitting before taking a system live →

What is an Expert Advisor? →

Explore Systems Lab ↗

Have your strategy reviewed systematically →