What is data leakage, and why does it ruin market models?
Leakage is using information you would not have had
Data leakage happens when a model is trained with information that would not have been available at the moment of the decision. A classic case is computing a feature using the full dataset, including future points, and then testing on that same period. The model appears to predict because it quietly already knew the answer.
Leakage is dangerous precisely because it is invisible in the results. The backtest looks excellent. The problem only appears when real money meets a market where the future is genuinely unknown.
Common sources in market data
Typical culprits include normalizing with statistics computed over the whole series, using a label that overlaps the feature window, aligning data to the wrong timestamp, or including a value that is only published after the fact. Survivorship bias, testing only on instruments that still exist today, is a related trap.
How honest researchers guard against it
They separate data in time, fit every transformation only on past data, and respect the exact moment information becomes available. They are suspicious of results that look too good, because in markets a result that looks too good usually is.
Common questions
How do I know if my backtest has leakage?
Is leakage always obvious?
This article is general educational information only. It is not financial, investment, or trading advice, and not a recommendation to buy or sell any instrument. Markets carry risk of loss, and past performance does not guarantee future results. Consult a qualified, licensed professional before making any decision.
← All guides