QBMFX Academy

Walk-Forward and Out-of-Sample Validation

By QBMFX Academy · Updated · Editorial standards

Walk-forward validation repeatedly fits a model on past data and evaluates a frozen version on the next unseen interval. It estimates how a research process might behave when updated over time.

How it works

Define training length, test length, update schedule, parameter search and cost model before testing. Keep an outer final holdout for the research process where feasible. If labels overlap across boundaries, remove or separate overlapping observations to limit information leakage.

Worked example

Train using 2018–2020, freeze the selected rule and evaluate January–June 2021. Then roll or expand training through June 2021 and evaluate July–December 2021. Combine only the genuinely forward test returns. Do not replace a losing early test segment with the parameters selected after seeing it.

Amounts, prices and scenarios are fictional teaching examples. They exclude any effects not explicitly stated and are not trade recommendations.

Limits and common mistakes

Repeatedly inspecting the same holdout turns it into training data. Short test intervals can yield unstable estimates and changing market structure can invalidate past results. Report turnover, sample size, drawdowns and costs alongside averages.

Knowledge check

May you tune parameters using the next test interval’s results?

Read the explanation

You may use completed results for a later update, but that interval is no longer an untouched evaluation of the earlier research choice.

References and further reading

These sources explain the underlying concepts and specifications. They do not endorse QBMFX Academy. Check the relevant market, protocol version and reporting rules before applying an example.