Walk-forward testing repeats a simple cycle through history: choose settings on one window of data, then test them on the next window that wasn't used to choose them. The test windows, stitched together, form an out-of-sample record.
The cycle
Example (hypothetical, four years of data).
| Step | Choose settings on | Test on |
|---|---|---|
| 1 | Year 1 | First half of year 2 |
| 2 | Year 1.5 to 2.5 (rolled forward) | Second half of year 2 |
| 3 | Rolled forward again | First half of year 3 |
| ... | ... | ... |
Each test window uses only settings chosen from earlier data, so the stitched test results simulate how the strategy, including its process of choosing settings, would have performed going forward.
What it shows
- Whether the settings-choosing process works, not just whether one set of settings fit the past.
- Stability: do chosen settings jump around wildly from window to window? If so, the "optimal" values are mostly noise.
- Degradation: how much worse test windows are than the choosing windows.
Limits
- It still uses one history, and every walk-forward design choice (window lengths, what is optimized) is itself a choice that can be tuned. Decide them in advance.
- Short windows mean few trades per window, so results are noisy.
- Running many walk-forward designs and picking the best reintroduces overfitting.
Takeaways
- Walk-forward chooses settings on past windows and tests on the following ones.
- The stitched test windows form an out-of-sample record of the whole process.
- Fix the design in advance and watch for unstable chosen settings.
Common misconceptions
- "Walk-forward eliminates overfitting." It reduces it; design choices can still be tuned.
- "The latest optimized settings are the best to trade." If settings jump around, none of them is reliably best.