Matana Labs

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

Median in-sample and out-of-sample Sharpe of the selected parameter set by family
Median in-sample and out-of-sample Sharpe of the selected parameter set by family

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).

Share of folds where the in-sample winner stays in the top quarter, by segment
Share of folds where the in-sample winner stays in the top quarter, by segment

Results by segment

SegmentSelectionFoldsMedian in-sample SharpeMedian out-of-sample SharpeMedian candidate, out of sampleWinner stays in top quarterProfitable out of sample
US stocks & ETFsdaily signals, within family24,0720.590.05−0.0830%49%
US stocks & ETFsintraday signals, within family20,060−0.08−0.52−1.1763%32%
US stocks & ETFsbest of all strategies4,0121.330.16−0.3342%53%
Cryptodaily signals, within family2,3160.60−0.04−0.3332%35%
Cryptointraday signals, within family1,930−0.05−0.33−3.0969%43%
Cryptobest of all strategies3864.111.69−0.8669%67%
FX & spot metalsdaily signals, within family3,1860.370.000.0025%36%
FX & spot metalsintraday signals, within family2,655−2.12−2.73−5.7771%9%
FX & spot metalsbest of all strategies5310.960.00−0.7449%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

SegmentInstrumentsSecond-level data usedMedian history (min to max)SessionsNotes
US stocks & ETFs2912003-09-10 to 2026-11-1920.9 years (1.8 to 23.2)1,233,39525 sessions excluded by data checks; 286 split adjustments (67 uncertain)
Crypto932013-11-01 to 2026-11-195.5 years (2.0 to 13.0)198,978470 sessions excluded by data checks; 146 split adjustments (120 uncertain)
FX & spot metals332009-09-24 to 2026-11-1917.2 years (3.1 to 17.2)167,3602 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

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 Lab

Download the summary data

Aggregated statistics only, no price series and no trade lists. Licence: CC BY 4.0; please credit Matana Labs.

Columns of by_family.csv (Walk-forward overfitting)
  • folds: folds
  • median_is_sharpe: as above
  • median_oos_sharpe: as above
  • share_top_quarter: as above
  • share_oos_profitable: as above
Columns of summary.csv (Walk-forward overfitting)
  • folds: walk-forward folds
  • median_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 return
  • share_beat_family_median: share of folds where it beats the candidates' median out of sample
  • median_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/

Updated 2026-11-22. Research on historical data, not financial advice.

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.

ShareXLinkedInRedditHacker NewsEmail