Use your browser's “Save as PDF” destination for a paper-ready file.
QuanterLab
QuanterLab Research · Pre-registered Walk-Forward Study

Regime aware portfolio

A pre-registered, point-in-time walk-forward investigation with a multiple-testing (deflated Sharpe) correction.
Universe · S&P 500 (point-in-time constituents)
Method · Evolving (fork-and-prune per step)
Step size · 1 year per forward window
In-sample · 2 years before each anchor
Out-of-sample span · 2016-01-04 → 2023-12-29
Compiled · July 23, 2026
Abstract

We pre-register and walk a strategy forward across S&P 500 in 1-year steps, each tested out-of-sample on data the strategy had never touched, with survivorship-bias-free constituents reconstructed as of every anchor. Stitched end to end, the walk realises an annualised Sharpe of 0.45 over 2005 out-of-sample observations. Deflating for the 11 trials the search actually ran gives a probabilistic deflated Sharpe of 36% — the strategy does not survive the multiple-testing correction — most likely an artifact of the search. Every attempt made along the way — 11 registered circuits, pruned candidates included — is counted in the correction, so the headline number reflects the true cost of the search.

Author’s note

We constructed a regime-aware system because the foundational challenge in walk-forward optimization is that market conditions shift. A strategy optimized on in-sample data from one market regime often stumbles when the regime changes. By layering regime classification on top of our evolving fork-and-prune method, we aimed to give the algorithm a mechanism to adjust its posture — not just its parameters, but its deployment intensity — in response to realized market state.

Our universe of S&P 500 constituents is rarely homogeneous in character. During calm periods, we expected to deploy capital fully. During choppy and stressed regimes, we expected to reduce exposure or hold idle capital, accepting lower upside in exchange for dampened downside. The regime signal itself would be learned in-sample during each two-year window, then applied out-of-sample in the walk-forward step that followed. This design addressed a persistent frustration with pure optimization: a portfolio tuned for rising markets often looks foolish when volatility spikes. We hypothesized that explicit regime awareness would narrow the performance gap between in-sample promise and out-of-sample reality, even if it meant leaving some upside on the table during bull markets.

Economic rationale

We examine a regime-aware portfolio strategy that adapts its composition and leverage dynamically across market conditions, testing whether explicit recognition of time-varying factor exposures can improve risk-adjusted returns. The core premise is straightforward: factor returns are not stationary over long horizons, and a strategy locked into static assumptions risks persistently overweighting factors in drawdown or underweighting them in recovery. Rather than choose a single factor configuration and hold it fixed, we allow the model to evolve its regime inference and portfolio construction at each annual step, retraining on a rolling two-year window and testing forward out-of-sample. We walk forward eight steps across S&P 500 constituents between 2016 and 2023, accumulating 2005 out-of-sample observations to assess whether such adaptation translates into measurable edge, or whether apparent improvements dissolve under multiple-testing correction.

The regime-aware approach produced a pooled annualized Sharpe of 0.449 across all eight steps, though this figure deflates to 36 percent of its nominal value when adjusted for the multiple comparisons inherent in our 11 trials of model construction and selection. The verdict does not survive the correction: the strategy is most likely an artifact of the search process rather than a robust signal. This is an honest outcome and worth stating plainly, because it tells us something important about the adaptive strategy itself.

Examining the regime attribution reveals precisely where adaptiveness matters and where it fails. In bull regimes, which account for 65.6 percent of the 1949 total bars, the strategy delivered an annualized return of 21.1 percent against a benchmark of 32.2 percent, with a Sharpe of 1.29. The strategy was right more often than not, hitting on 55.8 percent of bars. In bear regimes (19.6 percent of observations), it fell to an annualized negative 16.8 percent versus a benchmark of negative 21.7 percent, and in choppy regimes (14.7 percent of observations), it returned negative 15.8 percent against negative 16.7 percent. The adaptation did preserve capital relative to buy-and-hold during downturns, which is the intended economic benefit of regime awareness. Yet the cumulative effect does not materialize: the strategy stitched together 64.5 percent total return over eight years while the benchmark achieved 133.4 percent. The regimes themselves operated as intended—calm conditions (54.5 percent of time) saw full deployment, while choppy and stressed regimes scaled down to 75 and 50 percent respectively—but the cost of being out of the market during recovery phases outweighed the protection gained.

The within-sample train-test dynamics expose another layer of the adaptiveness question. The model retrained annually, allowing factor weights and regime parameters to shift as market structure changed. Step 2 (2017) produced a Sharpe of 1.89, the highest of the walk, yet by step 3 (2018) it collapsed to negative 0.91, and subsequent steps remained scattered between negative 0.063 and 1.209. This volatility in performance across consecutive one-year periods suggests that even with a two-year training window, regime inference remained brittle; the model's ability to predict the next regime's factor configuration from recent history did not hold consistently. The deflated Sharpe at each step ranged from 0.0168 in 2018 to 0.7671 in 2017, confirming that raw annual returns bore little relationship to their statistical reliability.

From a probabilistic angle, the Monte Carlo simulation offers a more constructive picture. Running 11 randomized trial runs of the strategy yielded a 65.8 percent probability of positive returns, with a median terminal wealth multiple of 1.0646, a 95th percentile of 1.3519, and a 5th percentile floor of 0.8146. The median drawdown reached 14.3 percent, rising to 26.7 percent at the 95th percentile. These distributions suggest that the strategy does tilt toward positive outcomes when run in repeated conditions, even if the realized walk-forward path did not capture the expected value. In this sense, adaptiveness worked: the regime mechanism did steer the strategy away from the worst outcomes seen in a fraction of trial runs. Yet this probabilistic benefit did not translate into beating a static long-only benchmark over the actual eight-year period tested.

The central lesson is that adaptiveness in portfolio design operates on two distinct planes that do not always align. In a probabilistic or out-of-sample simulation context, regime awareness reduced tail risk and improved hit rates relative to passive holding. In the realized historical walk, however, the costs of being underweighted during prolonged bull markets and the imperfection of regime detection overwhelmed those protections. The factor rotation intuition is sound—factor returns do rotate over time, and static assumptions do impose real drag—but detecting and responding to those rotations within annual rebalancing cycles proved insufficient to overcome the opportunity cost of reduced exposure during the 2016–2023 bull phase, which itself dominated the period.

1  Methodology

The study is sealed before it starts: the universe, the step size and the method are fixed at registration and cannot be changed while the walk is running, and the anchor advances only forward. This removes the two commonest ways a backtest flatters itself — moving the test window until the numbers look good, and changing the rules with hindsight.

At each step the strategy is fitted on the 2 years of history ending at the anchor and then tested on the subsequent out-of-sample window it had never seen. Index membership is reconstructed as of the anchor date from the exchange's dated constituent change-log, so names that were later removed or delisted still compete on the dates they actually traded and there is no survivorship bias. Under the evolving method, each step may try several candidate circuits; one is kept and the rest are pruned. Crucially, every candidate — kept or discarded — is registered and counts toward the trial total below.

The inferential statistic is the Deflated Sharpe Ratio (Bailey and López de Prado, 2014), which asks: given that 11 configurations were tried, what is the probability that the observed Sharpe is genuinely positive rather than the best of many noisy draws? The number of trials is frozen at compile time and taken as the larger of the registered circuit count and the number of logged runs, so it can never understate the search.

2  Results

2.1  Headline

Pooled deflated Sharpe
36%
annualised SR 0.45 · 2005 OOS bars
Trials in the search (N)
11
11 registered
Stitched total return
+64.5%
benchmark +133.4%
0.78x1.62x2.46x
Figure 1. The whole walk, stitched. Each step's out-of-sample leg is chained in calendar order into one continuous growth-of-1 track (green), with the benchmark (grey) compounded through the identical windows. Dotted verticals mark the step boundaries; the dashed horizontal is break-even. The translucent bands are the circuit's own detected regime —  calm,  choppy,  stressed (Table 2).

2.2  Per-step results

Table 1. One row per surviving step. The deflated Sharpe uses the cumulative trial count at that step, so it falls as the search widens — the decay is the point.
#StepOut-of-sample window NSharpeDeflated
1 Regime aware portfolio · step 1 2016-01-04 → 2016-12-30 1 0.32 62%
2 Regime aware portfolio · step 2 2017-01-03 → 2017-12-29 4 1.89 77%
3 Regime aware portfolio · step 3 2018-01-02 → 2018-12-31 5 -0.91 2%
4 Regime aware portfolio · step 4 2019-01-02 → 2019-12-31 6 0.25 15%
5 Regime aware portfolio · step 5 2020-01-02 → 2020-12-31 7 0.08 10%
6 Regime aware portfolio · step 6 2021-01-04 → 2021-12-31 8 1.21 40%
7 Regime aware portfolio · step 7 2022-01-03 → 2022-12-30 9 -0.06 6%
8 Regime aware portfolio · step 8 2023-01-03 → 2023-12-29 10 1.03 29%
0.75x1.08x1.41x
Figure 2. Every step's out-of-sample curve overlaid, each rebased to 1× at its own start. Read alongside Table 1: consistent shape across steps is the walk-forward's evidence; a single lucky leg is not.

2.3  Trial accounting

The search registered 11 circuits in total (pruned candidates included); the correction uses this registered-circuit count, N = 11. The pooled deflated Sharpe is the inferential headline; the per-step deflated track in Table 1 is illustrative, since near-identical variants are correlated and per-step deflation over-penalises.

2.4  Regime routing and capital exposure

The circuit routes capital by market regime: a classifier labels each period calm, choppy or stressed and the strategy re-weights — and, crucially, de-risks — accordingly. Those states are the translucent bands behind Figure 1. This is where a regime overlay earns or loses its keep: the table below shows how often the book sat in each state and how much capital it actually put to work there versus held idle in cash. A model that retreats to cash in choppy and stressed periods gives up return for a smoother ride — the trade-off is visible here, not hidden in the headline.

Table 2. Time spent in each detected regime and the average capital deployed there. The remainder is idle cash — the drag when the router de-risks.
RegimeTime in stateCapital deployedIdle cash
Calm 54.5% 100.0% 0.0%
Choppy 21.7% 75.0% 25.0%
Stressed 23.8% 50.0% 50.0%

3  Strategy specification and evolution

Each step's strategy is a circuit of platform primitives, frozen at registration. The table lists the full component set per step and — where the hypothesis evolved — exactly what changed against the previous step: components added, removed, or re-tuned.

Table 3. The frozen component specification per step. Parameters shown are the reproduction-relevant ones; the complete circuit is preserved in the study ledger (Appendix A).
#Components (primitives & key parameters)Evolution vs previous step
1 universe (preset=sp500) · price loader · factor loader · factor value · factor quality · factor momentum · factor growth · factor regime tilt · factor composite · regime gmm (n_regimes=auto) · vix regime · hmm vol · regime ensemble (method=majority) · factor top tier · portfolio backtest (horizon=1y, rebalance=quarterly, selection=reselect) · portfolio forward autopsy · monte carlo (horizon=1y)
2 universe (preset=sp500) · price loader · factor loader · factor value · factor quality · factor momentum · factor growth · factor regime tilt · factor composite · regime gmm (n_regimes=auto) · vix regime · hmm vol · regime ensemble (method=majority) · factor top tier · portfolio backtest (horizon=1y, rebalance=quarterly, selection=reselect) · portfolio forward autopsy · monte carlo (horizon=1y) unchanged — carried forward
3 universe (preset=sp500) · price loader · factor loader · factor value · factor quality · factor momentum · factor growth · factor regime tilt · factor composite · regime gmm (n_regimes=auto) · vix regime · hmm vol · regime ensemble (method=majority) · factor top tier · portfolio backtest (horizon=1y, rebalance=quarterly, selection=reselect) · portfolio forward autopsy · monte carlo (horizon=1y) unchanged — carried forward
4 universe (preset=sp500) · price loader · factor loader · factor value · factor quality · factor momentum · factor growth · factor regime tilt · factor composite · regime gmm (n_regimes=auto) · vix regime · hmm vol · regime ensemble (method=majority) · factor top tier · portfolio backtest (horizon=1y, rebalance=quarterly, selection=reselect) · portfolio forward autopsy · monte carlo (horizon=1y) unchanged — carried forward
5 universe (preset=sp500) · price loader · factor loader · factor value · factor quality · factor momentum · factor growth · factor regime tilt · factor composite · regime gmm (n_regimes=auto) · vix regime · hmm vol · regime ensemble (method=majority) · factor top tier · portfolio backtest (horizon=1y, rebalance=quarterly, selection=reselect) · portfolio forward autopsy · monte carlo (horizon=1y) unchanged — carried forward
6 universe (preset=sp500) · price loader · factor loader · factor value · factor quality · factor momentum · factor growth · factor regime tilt · factor composite · regime gmm (n_regimes=auto) · vix regime · hmm vol · regime ensemble (method=majority) · factor top tier · portfolio backtest (horizon=1y, rebalance=quarterly, selection=reselect) · portfolio forward autopsy · monte carlo (horizon=1y) unchanged — carried forward
7 universe (preset=sp500) · price loader · factor loader · factor value · factor quality · factor momentum · factor growth · factor regime tilt · factor composite · regime gmm (n_regimes=auto) · vix regime · hmm vol · regime ensemble (method=majority) · factor top tier · portfolio backtest (horizon=1y, rebalance=quarterly, selection=reselect) · portfolio forward autopsy · monte carlo (horizon=1y) unchanged — carried forward
8 universe (preset=sp500) · price loader · factor loader · factor value · factor quality · factor momentum · factor growth · factor regime tilt · factor composite · regime gmm (n_regimes=auto) · vix regime · hmm vol · regime ensemble (method=majority) · factor top tier · portfolio backtest (horizon=1y, rebalance=quarterly, selection=reselect) · portfolio forward autopsy · monte carlo (horizon=1y) unchanged — carried forward

4  Pre-registration record

The integrity of a walk-forward rests on registering each hypothesis before its out-of-sample window is scored. The order below is the order in which the hypotheses were sealed.

Table 4. The registered hypothesis for each step, with its registration timestamp.
#Registered hypothesisAnchorRegistered at
1 “S&P 500, rebalanced quarterly across the selected basket, conditioned on the wired regime classifiers, and run out-of-sample from the anchor — with no in-sample parameters to optimize, a walk-forward does not apply; its disposition is the realized forward path versus the benchmark, is expected to generate positive risk-adjusted returns over the forward test window.” 2016-01-01 2026-07-22
2 “S&P 500, rebalanced quarterly across the selected basket, conditioned on the wired regime classifiers, and run out-of-sample from the anchor — with no in-sample parameters to optimize, a walk-forward does not apply; its disposition is the realized forward path versus the benchmark, is expected to generate positive risk-adjusted returns over the forward test window.” 2017-01-01 2026-07-22
3 “S&P 500, rebalanced quarterly across the selected basket, conditioned on the wired regime classifiers, and run out-of-sample from the anchor — with no in-sample parameters to optimize, a walk-forward does not apply; its disposition is the realized forward path versus the benchmark, is expected to generate positive risk-adjusted returns over the forward test window.” 2018-01-01 2026-07-22
4 “S&P 500, rebalanced quarterly across the selected basket, conditioned on the wired regime classifiers, and run out-of-sample from the anchor — with no in-sample parameters to optimize, a walk-forward does not apply; its disposition is the realized forward path versus the benchmark, is expected to generate positive risk-adjusted returns over the forward test window.” 2019-01-01 2026-07-22
5 “S&P 500, rebalanced quarterly across the selected basket, conditioned on the wired regime classifiers, and run out-of-sample from the anchor — with no in-sample parameters to optimize, a walk-forward does not apply; its disposition is the realized forward path versus the benchmark, is expected to generate positive risk-adjusted returns over the forward test window.” 2020-01-01 2026-07-22
6 “S&P 500, rebalanced quarterly across the selected basket, conditioned on the wired regime classifiers, and run out-of-sample from the anchor — with no in-sample parameters to optimize, a walk-forward does not apply; its disposition is the realized forward path versus the benchmark, is expected to generate positive risk-adjusted returns over the forward test window.” 2021-01-01 2026-07-22
7 “S&P 500, rebalanced quarterly across the selected basket, conditioned on the wired regime classifiers, and run out-of-sample from the anchor — with no in-sample parameters to optimize, a walk-forward does not apply; its disposition is the realized forward path versus the benchmark, is expected to generate positive risk-adjusted returns over the forward test window.” 2022-01-01 2026-07-22
8 “S&P 500, rebalanced quarterly across the selected basket, conditioned on the wired regime classifiers, and run out-of-sample from the anchor — with no in-sample parameters to optimize, a walk-forward does not apply; its disposition is the realized forward path versus the benchmark, is expected to generate positive risk-adjusted returns over the forward test window.” 2023-01-01 2026-07-22

5  Discussion

A garden of forking paths (Gelman and Loken, 2013) is not cheating — it is what honest research feels like from the inside. At each step there were several defensible things to try, and trying them is the work. What separates research from a hunt for a flattering backtest is that the paths not taken are still counted. Here they are: an annualised Sharpe of 0.45 over the stitched walk, deflated to 36% once the 11 trials are accounted for. The strategy does not survive the multiple-testing correction — most likely an artifact of the search.

Pooled deflated Sharpe is the inferential number; the per-step DSR track is illustrative (near-identical variants are correlated, so per-step N over-deflates). N is a conservative upper bound on the multiple-testing penalty, frozen at compile time and taken as the larger of the lineage trial count and the explored-runs count so it cannot understate the search. Integrity rests on pre-registration: each step's submitted_at is the registration order, auditable against when its OOS was scored.

6  Deep-dive autopsy

The completed walk, dissected. Everything below is computed from the frozen study artifact alone (seed 1234) — no re-run, no new data — so this analysis is reproducible exactly.

6.1  When it works, when it doesn't — regime attribution

Each bar of the stitched walk is classified bull / bear / choppy from the trailing quarter of the benchmark track (63-bar window, ±2% threshold).

Figure 3. The walk's regime weather, left to right — green bull, red bear, grey choppy, pale warmup.
Table 5. Performance by regime — the credo, quantified.
RegimeBarsShare Strategy ann.Sharpe Benchmark ann. Hit rate
bull 1274 65.6% 21.1% 1.29 32.2% 55.8%
bear 381 19.6% -16.8% -0.77 -21.7% 50.9%
choppy 286 14.7% -15.8% -0.82 -16.7% 50.3%

6.2  Probabilistic projection — Monte Carlo

2000 circular block-bootstrap paths (block 10, seed 1234) of the stitched out-of-sample returns, projected 252 bars forward. A resampling of what WAS — not a forecast of what will be.

P(positive at horizon)
65.8%
terminal growth > 1×
Terminal growth (p5 / p50 / p95)
0.8146× / 1.0646× / 1.3519×
Max drawdown (median / p95)
−14.3% / −26.7%
within the horizon
0.77x1.00x1.39xbars forward → · bands: p5–p95 light, p25–p75 mid, median line
Figure 4. The projection fan — percentile bands of 2000 bootstrapped forward paths.

6.3  Per-window dissection

Table 6. Each step's window on the operating table: return vs benchmark, volatility, drawdown, and the regime mix it traded through.
#WindowReturn BenchmarkExcess VolMax DDRegime mix
1 2016-01-04 → 2016-12-30 +3.3% +11.2% -7.9% 13.0% −9.7% bull 71% · bear 4% · choppy 26%
2 2017-01-03 → 2017-12-29 +27.4% +18.5% +8.9% 13.4% −8.6% bull 91% · choppy 9%
3 2018-01-02 → 2018-12-31 -15.8% -7.0% -8.8% 17.3% −22.4% bull 51% · bear 30% · choppy 18%
4 2019-01-02 → 2019-12-31 +2.3% +28.7% -26.4% 12.3% −10.8% bull 67% · bear 10% · choppy 24%
5 2020-01-02 → 2020-12-31 -0.8% +15.1% -15.9% 22.3% −23.0% bull 71% · bear 25% · choppy 4%
6 2021-01-04 → 2021-12-31 +29.2% +28.8% +0.4% 23.7% −12.1% bull 93% · choppy 7%
7 2022-01-03 → 2022-12-30 -2.5% -19.9% +17.4% 17.0% −11.9% bull 16% · bear 71% · choppy 13%
8 2023-01-03 → 2023-12-29 +16.0% +24.8% -8.8% 15.8% −14.5% bull 67% · bear 13% · choppy 20%

References

  1. Bailey, D. H., & López de Prado, M. (2014). The Deflated Sharpe Ratio: Correcting for Selection Bias, Backtest Overfitting, and Non-Normality. Journal of Portfolio Management, 40(5), 94–107.
  2. Gelman, A., & Loken, E. (2013). The garden of forking paths: Why multiple comparisons can be a problem, even when there is no “fishing expedition.” Working paper, Columbia University.
  3. Harvey, C. R., Liu, Y., & Zhu, H. (2016). … and the Cross-Section of Expected Returns. Review of Financial Studies, 29(1), 5–68.
  4. Lo, A. W. (2002). The Statistics of Sharpe Ratios. Financial Analysts Journal, 58(4), 36–52.

Appendix A  Reproducibility

Each step is backed by a frozen run report. The study is re-derivable from the ledger below.

#CommitReportAnchorOOS window
1 f5d34a004116 256 2016-01-01 2016-01-04 → 2016-12-30
2 007b403b1f75 257 2017-01-01 2017-01-03 → 2017-12-29
3 3e4d52220a7b 258 2018-01-01 2018-01-02 → 2018-12-31
4 2c97fa4cd586 259 2019-01-01 2019-01-02 → 2019-12-31
5 0d446a9e665c 260 2020-01-01 2020-01-02 → 2020-12-31
6 b544e634397b 262 2021-01-01 2021-01-04 → 2021-12-31
7 bf99842d97c5 264 2022-01-01 2022-01-03 → 2022-12-30
8 9de35299dcf6 265 2023-01-01 2023-01-03 → 2023-12-29

Appendix B  Per-step diagnostics

What each step's run actually did beyond its return: capital allocation across lanes and regimes, the portfolio book's rebalancing and cost drag, and how positions were sized. Harvested from the frozen run reports — present where the circuit produced them.

Step 1 · 2016-01-04 → 2016-12-30

Portfolio book — rebalanced quarterly · 4 constructions · 18 names held · selection: reselect · 0% in cash · turnover 0× · cost drag 0% · regime gate active

Step 2 · 2017-01-03 → 2017-12-29

Portfolio book — rebalanced quarterly · 5 constructions · 16 names held · selection: reselect · 0% in cash · turnover 0× · cost drag 0% · regime gate active

Step 3 · 2018-01-02 → 2018-12-31

Portfolio book — rebalanced quarterly · 5 constructions · 14 names held · selection: reselect · 0% in cash · turnover 0× · cost drag 0% · regime gate active

Step 4 · 2019-01-02 → 2019-12-31

Portfolio book — rebalanced quarterly · 5 constructions · 11 names held · selection: reselect · 0% in cash · turnover 0× · cost drag 0% · regime gate active

Step 5 · 2020-01-02 → 2020-12-31

Portfolio book — rebalanced quarterly · 4 constructions · 19 names held · selection: reselect · 0% in cash · turnover 0× · cost drag 0% · regime gate active

Step 6 · 2021-01-04 → 2021-12-31

Portfolio book — rebalanced quarterly · 5 constructions · 19 names held · selection: reselect · 0% in cash · turnover 0× · cost drag 0% · regime gate active

Step 7 · 2022-01-03 → 2022-12-30

Portfolio book — rebalanced quarterly · 5 constructions · 17 names held · selection: reselect · 0% in cash · turnover 0× · cost drag 0% · regime gate active

Step 8 · 2023-01-03 → 2023-12-29

Portfolio book — rebalanced quarterly · 5 constructions · 19 names held · selection: reselect · 0% in cash · turnover 0× · cost drag 0% · regime gate active

QuanterLab · Study e472af4d7c8e · compiled July 23, 2026. Point-in-time constituents, transaction costs and pre-registration timestamps are enforced by the platform. This report is generated from the frozen study artifact and is reproducible from the ledger above.