How to choose IS/OOS window sizes in walk-forward analysis
How to pick in-sample and out-of-sample window lengths for walk-forward tests, trade-offs for crypto and futures, and sanity checks before you trust results.
Walk-forward analysis window size is one of the most debated settings in WFA. Searches like walk forward analysis timeframe, IS OOS split strategy testing, and walk-forward analysis window size all point to the same problem: there is no universal best pair of in-sample and out-of-sample lengths.
The constraints you are balancing
- IS too short: parameters fit noise; OOS looks random.
- IS too long: stale regimes dominate; your "training" is not representative of what you trade now.
- OOS too short: a lucky month dominates metrics (How many trades).
- OOS too long: fewer windows fit in your history (Minimum windows).
Start from trade count, not only calendar length
A 30-day OOS window might contain 5 trades or 500 trades depending on timeframe and filters. Build windows so each OOS segment has enough trades for stable metrics under your strategy's variance.
Crypto-specific notes
Walk-forward analysis crypto often has shorter reliable history and higher volatility. That pushes you toward more windows with shorter steps if you need regime coverage, but not so short that each OOS slice is pure noise (Crypto WFA step-by-step).
Anchored vs rolling interacts with window choice
If you use expanding training data, your effective IS grows. Compare against rolling designs when results look unstable (Anchored vs rolling).
Sanity checks before trusting outputs
- Do results change drastically if you shift window boundaries by a few bars? If yes, you may be fitting microstructure noise.
- Do costs dominate thin edges in OOS? Stress fees (Cost drag).