Look-ahead bias
Availability time is what matters
Distinguish the observation’s reference period, publication time, retrieval time and subsequent revision. Data for a previous month were not available throughout that month. A revised series downloaded today can contain information absent at the decision. See St. Louis Fed: FRED/ALFRED real-time periods for historical vintages. Use explicit timezones and data delays.
A hindsight chart can look different
A swing confirmed by two later bars was not known at the extreme itself. ZigZag or another tool changing historical markings must be evaluated using what it showed at the decision. Repainting is not always the same error, and reading a partial bar is not categorically prohibited. Information availability and consistency between simulation and real-time behaviour are the relevant conditions.
Errors in other-timeframe data
In Pine Script, unoffset higher-timeframe data with lookahead_on can reveal a final value prematurely on historical bars. For appropriate HTF requests, using the preceding confirmed value with the correct configuration defines a separate delayed-information model. Changing a single flag does not solve every error. See the method and limitations in TradingView’s official documentation.
Signal and fill occur at different times
If a condition requires the final close, the calculation becomes available only after the relevant close and data update. Do not automatically assume a fill at that price without modelling order acceptance, bid/ask side and latency. Waiting for confirmation can change entry. The test should reproduce this sequence rather than move profitable signals backwards onto the bar whose outcome has just become known.
Practical checks
For selected signals, record inputs, availability time, decision time and fill time. Replay history step by step, including session boundaries and revisions. Fitting scaling or features on the entire history can also leak information into a test. In the course: backtesting and forward testing. Sources checked on 11 October 2026.