Walk-forward analysis fits a strategy’s parameters on a window of historical data, tests them on the following window, then rolls both windows forward and repeats. Every test period is out-of-sample — the strategy never saw that data when its parameters were chosen.
It’s the closest a backtest can get to simulating what actually happens when you deploy.
Why plain backtesting isn’t enough
A standard backtest optimises parameters on the whole history and reports how well those parameters did — on the same history. Of course they did well. They were chosen to.
That’s overfitting, and it’s invisible from inside the backtest because the fit is real. It just describes the past rather than predicting anything.
How walk-forward works
Fit on months 1–12, test on month 13. Fit on months 2–13, test on month 14. Continue to the end. Stitch the out-of-sample months together into a single equity curve.
That curve is what the strategy would have produced if you’d re-optimised it monthly and traded the result — which is what you’d actually do.
What it reveals
Parameter stability. If the optimal parameters swing wildly from window to window, the strategy is fitting noise. If they’re stable and out-of-sample performance holds, there’s something real.
What it still can’t prove
That the future resembles any past window. Walk-forward defends against overfitting the past; it can’t defend against a regime that has never occurred.