Walk-forward reality: how optimized backtests decay out of sample
Optimizing a strategy on past data and trading the winner forward loses most of the in-sample edge. In 24,072 walk-forward folds on US stocks and ETFs, the best parameter set of a daily-signal family fell from a median Sharpe of 0.59 in sample to 0.05 out of sample, and it stayed in its family's top quarter only slightly more often than chance would predict.
Key findings
- Daily-signal strategies: the median in-sample Sharpe of 0.59 became 0.05 out of sample (95% CI 0.02 to 0.07). The winner finished in its family's top quarter the next period in 30% of 24,072 folds (95% CI 29% to 30%), against 25% by pure chance, and made money in 49% of the following years.
- Intraday strategies: in-sample Sharpe −0.08, out-of-sample −0.52, profitable in 32% of folds. The winner stays in the top quarter more often (63%), but mostly because nearly every variant loses money after costs: the median candidate in these families had an out-of-sample Sharpe of −1.17. The least-losing variant tends to stay least-losing.
- Picking the best of all 102 strategies in sample (median in-sample Sharpe 1.33) gave a median out-of-sample Sharpe of 0.16, profitable in 53% of years: close to a coin flip.
- Optimization still helps a little: the selected daily-signal set beat the median candidate of its family in 55% of folds. The edge is real but small, far smaller than the in-sample number suggests.
Does the winner stay on top?
If optimization found a lasting edge, the in-sample winner would keep ranking near the top of its family on new data. It mostly doesn't. For daily-signal families the share of winners still in the top quarter is close to the 25% that random picks would give. Higher numbers for intraday families and crypto reflect costs and noisy data more than skill (see below).
Results by segment
| Segment | Selection | Folds | Median in-sample Sharpe | Median out-of-sample Sharpe | Median candidate, out of sample | Winner stays in top quarter | Profitable out of sample |
|---|---|---|---|---|---|---|---|
| US stocks & ETFs | daily signals, within family | 24,072 | 0.59 | 0.05 | −0.08 | 30% | 49% |
| US stocks & ETFs | intraday signals, within family | 20,060 | −0.08 | −0.52 | −1.17 | 63% | 32% |
| US stocks & ETFs | best of all strategies | 4,012 | 1.33 | 0.16 | −0.33 | 42% | 53% |
| Crypto | daily signals, within family | 2,316 | 0.60 | −0.04 | −0.33 | 32% | 35% |
| Crypto | intraday signals, within family | 1,930 | −0.05 | −0.33 | −3.09 | 69% | 43% |
| Crypto | best of all strategies | 386 | 4.11 | 1.69 | −0.86 | 69% | 67% |
| FX & spot metals | daily signals, within family | 3,186 | 0.37 | 0.00 | 0.00 | 25% | 36% |
| FX & spot metals | intraday signals, within family | 2,655 | −2.12 | −2.73 | −5.77 | 71% | 9% |
| FX & spot metals | best of all strategies | 531 | 0.96 | 0.00 | −0.74 | 49% | 43% |
Crypto caution. The crypto "best of all" row is dominated by 1-minute EMA and 5-minute RSI systems whose out-of-sample Sharpe ratios are not plausible for a tradable strategy. They come from thin altcoin pairs, where second-level prints bounce between bid and ask and include bad ticks. We treat them as data artefacts, not edges, and never use crypto for a headline.
Method
Question. If you optimize a strategy's parameters on past data and trade the best set on the next stretch of unseen data, how much of the in-sample result survives?
Backtests. The same 102 strategies and second-level fills as in the bar-resolution study: stops filled at the price of the second in which they trigger (as Matana Labs fills them), costs of 1 bp per side, 100% of equity per position. Each backtest's daily returns feed the walk-forward.
Walk-forward scheme. For instruments with at least 5 years of data: 3 years in sample, then 1 year out of sample, rolled forward one year at a time. Instruments with 2 to 5 years use 1 year and 6 months; those with 1.25 to 2 years use 1 year and 3 months. A year is 252 sessions for stocks and ETFs, 365 for crypto and 260 for FX.
Selection. In every fold, the parameter set with the highest in-sample annualized Sharpe is selected within its family (families with 4 to 24 parameter sets; NR7 breakouts and VWAP fades have too few and are skipped), and separately across all strategies. Its out-of-sample rank is its percentile among the same candidates. "Top quarter" means a rank in the best 25% out of sample. Confidence intervals are 95% CI from a cluster bootstrap over instruments (1,000 resamples, seed 20261120).
Daily series note. For this study the server stored day-by-day results of the second-level model with stops at their level. The difference to stops filled at the trigger second is known exactly for each backtest and was spread over that backtest's fills, so totals are exact and the day-by-day timing is approximate.
Data coverage
| Segment | Instruments | Second-level data used | Median history (min to max) | Sessions | Notes |
|---|---|---|---|---|---|
| US stocks & ETFs | 291 | 2003-09-10 to 2026-11-19 | 20.9 years (1.8 to 23.2) | 1,233,395 | 25 sessions excluded by data checks; 286 split adjustments (67 uncertain) |
| Crypto | 93 | 2013-11-01 to 2026-11-19 | 5.5 years (2.0 to 13.0) | 198,978 | 470 sessions excluded by data checks; 146 split adjustments (120 uncertain) |
| FX & spot metals | 33 | 2009-09-24 to 2026-11-19 | 17.2 years (3.1 to 17.2) | 167,360 | 2 split adjustments (0 uncertain) |
4 instruments (SPXL, SPXS, TNA, UPRO) are left out of this study because their day-by-day output from the server run was truncated; they are in the other studies. The first and last session of every instrument are in data-coverage.csv.
Limitations
- Survivorship. The universe is the set of instruments available in Matana Labs today; delisted companies are missing. That flatters absolute Sharpe ratios in and out of sample alike.
- Time period. Stocks and ETFs cover 2003 to 2026 at most, crypto and FX less. Folds of one instrument overlap in calendar time and are correlated, which is why the bootstrap is clustered by instrument.
- Costs model. A flat 1 bp per side. Higher real costs would hurt the high-turnover intraday families most and lower their out-of-sample results further.
- Uncertain split adjustments. Splits were detected from overnight gaps; some 3:2 or 2:3-type adjustments may be genuine price gaps (see the coverage table). They affect in-sample and out-of-sample windows alike.
- Small grids. 2 to 24 parameter sets per family, as in typical retail optimization. Larger grids overfit more.
- Noisy metric. Sharpe from one year of daily returns is a noisy estimate; that noise is part of what the study measures. Other selection metrics would select differently.
How the engine behind this study fills orders and charges costs: order execution model, costs and the engine validation.
Reproduce it in Matana Labs
Run your own strategy through the walk-forward analysis in Analysis Lab: it refits marked parameters on each window and stitches the test windows into one curve. Search parameters in Optimization Lab, then hold back data with the out-of-sample test before you trust the best set. The aggregated results of this study are below, under CC BY 4.0.
Reproduce this test in Matana LabsOpens Analysis Lab in the app. Sign in or create an account on the free Explore plan first.
Open Analysis LabDownload the summary data
Aggregated statistics only, no price series and no trade lists. Licence: CC BY 4.0; please credit Matana Labs.
- by_family.csv: Aggregated summary statistics: segment × strategy family
- summary.csv: Aggregated summary statistics: segment × selection (within a daily-signal family / within an intraday family / best of all strategies)
- data-coverage.csv: the first and last session used, sessions and split adjustments per instrument (shared by all studies)
Columns of by_family.csv (Walk-forward overfitting)
folds: foldsmedian_is_sharpe: as abovemedian_oos_sharpe: as aboveshare_top_quarter: as aboveshare_oos_profitable: as above
Columns of summary.csv (Walk-forward overfitting)
folds: walk-forward foldsmedian_is_sharpe: median annualized in-sample Sharpe of the selected parameter set (+95% CI)median_oos_sharpe: median out-of-sample Sharpe of the same set (+95% CI)share_top_quarter: share of folds where the selected set ranks in the top quarter out of sample (chance = 0.25)share_oos_profitable: share of folds with positive out-of-sample returnshare_beat_family_median: share of folds where it beats the candidates' median out of samplemedian_family_is_sharpe/oos_sharpe: median Sharpe of all candidates (unselected baseline)
Cite as: Matana Labs (2026). Walk-forward reality: how optimized backtests decay out of sample. matanalabs.com/research/walk-forward-overfitting/
Questions
Is optimization useless?
No, but its in-sample number is not a forecast. Expect much of the in-sample edge to disappear, and judge a strategy on its out-of-sample record.
How often does the best parameter set stay the best?
For daily-signal strategies, barely more often than chance. Where a winner does keep winning, it is often the variant that trades least and pays the least in costs.
What works better?
Prefer parameter regions where neighbouring settings also work, keep unseen data for the final check, and treat the median candidate, not the best one, as the expectation.