What is lookahead bias?
Using information the market had not published yet — usually filling at the same close that generated the signal. One index shift can invent an edge that never existed.
Guide · Research
Almost every strategy works on the data it was built on. The interesting question is whether it works on data it has never seen — and most of the ways people answer that question are quietly broken.
Lookahead bias is using information at bar t that was not available until after bar t. It is almost never deliberate, and it is almost always fatal to the result.
The classic version is off-by-one indexing: computing a signal from the daily close and then filling the order at that same close. In reality you cannot know the close until the session is over, so the fill must land on the next bar's open. One index shift can turn a losing system into a spectacular one.
Survivorship bias is testing on a universe that only contains what is still listed today. Delisted, acquired, and bankrupt tickers vanish from most convenient datasets, so the test never has to hold the ones that went to zero. Any long-biased strategy looks better against a universe that quietly deleted its worst outcomes.
Three levels of honesty:
| Method | What it does | How much to trust it |
|---|---|---|
| In-sample | Optimise and evaluate on the same data | None. This is curve fitting with extra steps. |
| Single out-of-sample split | Optimise on the first chunk, test once on the last | Some — but you only get one honest test, and looking twice spends it. |
| Walk-forward | Roll the optimise/test window forward repeatedly, always testing on unseen data | The most useful of the three, and still not a guarantee. |
Walk-forward works like this: fit parameters on a training window, test on the block immediately after it, then slide both windows forward and repeat. The reported result is the concatenation of every out-of-sample block. Because every trade in the result came from parameters chosen without seeing that trade, the equity curve is at least structurally honest.
Ask three questions of any backtest, including your own:
When I ran this on my own setups, the outcome was mostly negative: only the anchored-VWAP reclaim survived — at +0.23R over 101 trades, a number my own later adversarial re-test could not reproduce; on a 129-symbol, 10-year universe the defensible figure is +0.117R over 4,933 trades (95% CI +0.057 to +0.174). A VCP variant came out breakeven, and a gap/opening-range-breakout proxy came out at −0.28R and was cut. Two filters I was confident about — regime and normalised momentum lag — both reduced expectancy and were rejected.
That is the point of the exercise: an honest test is one that is allowed to say no. Full write-up and engine →
Educational content, not financial advice. No live profit-and-loss figures are claimed anywhere on this site; backtest and walk-forward results are always labelled as such. Full terms: /terms.html
FAQ
Using information the market had not published yet — usually filling at the same close that generated the signal. One index shift can invent an edge that never existed.
Fit on a training window, test on the next block, slide forward, repeat. Every reported trade came from parameters chosen before that trade existed.
Because the parameters were fitted to that data. It is curve fitting with extra steps — useful for debugging, useless as evidence.
Testing on a universe of survivors only. Delisted and bankrupt names are missing, so long strategies look better than they were.
100+ out-of-sample trades before expectancy means much. Under 30 you are measuring luck with a decimal point.
Slippage, commissions, financing, partial fills, borrow availability — and your own willingness to actually take every signal.