TradeHouse Fidelity Lab · Buyer resources
How does walk forward validation work?
Walk-forward validation tests a strategy the way it would have been run in real time: tune on the past, trade the next stretch you have not touched, then roll forward and repeat. The mechanics are simple enough to do on paper, so this page walks through a concrete schedule and the decisions at each step.
A worked 36-month schedule
Assume monthly data for three years, a 12-month training window and a 3-month test window that rolls forward 3 months at a time.
| Fold | Train months | Gap | Test months |
|---|---|---|---|
| 1 | 1 to 12 | month 13 | 14 to 16 |
| 2 | 4 to 15 | month 16 | 17 to 19 |
| 3 | 7 to 18 | month 19 | 20 to 22 |
| 4 | 10 to 21 | month 22 | 23 to 25 |
| 5 | 13 to 24 | month 25 | 26 to 28 |
| 6 | 16 to 27 | month 28 | 29 to 31 |
| 7 | 19 to 30 | month 31 | 32 to 34 |
Seven folds produce 21 months of out-of-sample results. Each test block was scored by a rule tuned only on earlier data. The stitched test blocks form the walk-forward curve. The first 13 months only ever serve as training or gap, which is why a walk-forward always shows less history than a full-sample backtest.
What happens inside each fold
- Fit. Choose parameters, thresholds or model weights using the training window only.
- Freeze. Write down the rule. Nothing about it may change during the test block.
- Gap. Skip a short period if your signals or labels look ahead by more than a day, so training outcomes do not overlap test entries.
- Trade. Apply the frozen rule to the test window with realistic fees and slippage.
- Record. Store the out-of-sample result and the parameters chosen. Unstable parameters across folds are a warning in themselves.
Choosing window lengths
Training windows must be long enough to estimate the rule with reasonable stability and short enough to adapt to regime change. Test windows must be long enough to contain a meaningful number of independent trades; a test block with five trades says almost nothing. A common starting point is a training window three to five times the test window, but the right ratio depends on how quickly the edge decays.
Reading the results
- Compare the average out-of-sample result with the in-sample result. The ratio is a rough measure of how much was fitting.
- Look at the spread across folds. One great fold and six flat ones is a different story from seven moderate ones.
- Check parameter stability. If the best lookback jumps from 10 to 80 between folds, the optimiser is fitting noise.
- Subtract realistic costs before concluding anything.
What walk-forward does not fix
Walk-forward guards against using the future inside a fold. It does not guard against the choice of strategy family, indicators or markets that you made after seeing the full history, nor against the number of variants you ran. If you tried 30 variants and walk-forwarded each, the best of the 30 still needs multiplicity control.
How Fidelity Lab performs it
For an uploaded trade file, Fidelity Lab splits at a date, freezes the threshold on the training split, scores it on test data with a one-day gap, reports the test net return and t-statistic, and then adds the effective sample size and Benjamini-Hochberg control across the cohorts you submitted. Where the file has too few independent days, the verdict is UNTESTABLE rather than a number. The related page on what walk-forward validation is covers the concept and variants.
Frequently asked questions
Rolling or anchored windows?
Rolling windows forget old data and suit changing markets. Anchored windows keep all history and suit stable relationships. Test both only if you count them as separate trials.
How many folds do I need?
Enough that the average is not dominated by one block. Five to ten is common, subject to having enough independent trades per fold.