Learning a strategy's settings on one stretch of history and judging it only on the months after, again and again.
The problem it solves
A backtest that picks a strategy's settings on the whole history and then reports its performance on that same history measures how well the settings fit the past, not how well the strategy would have done. It is like grading a student on the exam they wrote the answers to.
How it works
- Cut the history into windows: for instance 24 months to learn on, then 6 months to test on.
- On the first learning window, search the settings — the period of an average, the width of a band — that score best.
- Trade those settings, unchanged, on the 6 months that follow. That result is "out of sample": the search never saw it.
- Slide forward by 6 months and do it again, and again, to the end of the data.
- Put the out-of-sample periods end to end: that is what tuning the strategy as time went on would have earned.
What it tells you
Whether the way a strategy is tuned holds up over time — not just whether some settings once worked. A strategy whose best settings jump around from one window to the next, and whose out-of-sample results are far below its in-sample ones, is fitting noise.
What it does not solve
Walk-forward protects one strategy from its own settings. It does not protect a researcher who tries a hundred strategies and keeps the best one: that is what the deflated Sharpe ratio is for. Nor does it model everything: fees, slippage and the order of prices within a bar remain assumptions.