English · 한국어
A backtest can have correct arithmetic and still use future information. Ask a simple question: could this value actually have been known at the decision time?

Using a 1 p.m. close at 12:30
The final high, low, and close of a noon-to-1 p.m. bar are not known at 12:30. Assigning the final values throughout that hour lets an earlier decision see the future.
Store observation time separately from first availability time. Check whether API timestamps mark bar open or close. Publication delays require more than a join on observation timestamps.

Four frequent failures
A pivot requires later bars for confirmation; backdating its signal to the pivot bar leaks information. Completed higher-timeframe values are likewise available only after that bar finishes.
Fitting normalization or selecting features on the full dataset exposes evaluation data. Fit transformations on training data, then apply them forward.
Using today’s surviving symbols throughout history can omit delisted instruments. Reconstruct the eligible universe by date or state the limitation.
Defining a strong move as one followed by a rally embeds the outcome in the event. Keep detection conditions separate from later measurements.
Record the relevant clocks
| Field | Meaning |
|---|---|
| Source time | Original observation timestamp and timezone |
| Available time | First confirmed or published timestamp |
| Event confirmation | Time when all detection conditions were knowable |
| Outcome start | Beginning of observation after confirmation |
| Version | Data, code, parameters, and exclusion rules |
If you repeatedly inspected evaluation results while adjusting rules, that sample is no longer untouched. Label the process exploratory and evaluate on a separate later period.
Replay in chronological order
Check whether each signal can be recreated using only information available then. Log missing, revised, and excluded observations, and verify reproducibility from the same inputs. Eliminating known leakage is necessary; it is not evidence of profitability.
Continue with common foundations
Python data workflow · Pine Script guide · Research 001 · Research 002
Research methods and reporting standards
For education and research. Numerical examples are teaching assumptions unless explicitly identified otherwise. Historical results do not guarantee future performance.