Look-ahead bias and repainting: when was a pattern known?

Look-ahead bias occurs when a historical decision uses information that only became available later. Repainting means that previously displayed values or labels change. The concepts overlap, but are not identical: an unfinished candle naturally changes, while hidden future information invalidates a historical test.

One label, two times

Suppose a high occurs on Monday, but a rule needs two later completed bars with lower highs to confirm it. The label may be drawn on Monday to describe geometry. A simulated decision on Monday cannot use that confirmation: it was only available after Wednesday.

Confirmation delay is not necessarily a defect. Concealing the delay and treating a finished historical chart as contemporary knowledge is the problem.

Changes that are not automatically leakage

The current high, low and close update until a bar ends. A provisional interpretation can also change as new observations arrive. Its provisional status and earlier versions should remain distinguishable from the final result.

Backdating a final label without documenting its availability is different: the chart describes history, but does not establish timely actionability.

A reproducible check

  • Inspect successive prefixes of the data, adding new bars only after recording the earlier interpretation.
  • Record event time, data availability and confirmation time separately.
  • Model a decision based on the close no earlier than the moment that close is known.
  • Do not use the final daily high while that day is still developing.
  • Check revisions, corporate adjustments and changes of source.

This distinguishes causal information from retrospective illustration. It does not establish profitability; that requires independent testing.

See TradingView’s repainting documentation. The weekday example is hypothetical, not a detector specification.

Related questions