01-projects/investing/backtests

memory cycle v1 walk forward

2026-05-17·investing-backtest·status: completed·! medium
investingbacktestwalk-forwardmemory-cyclemusmhoverfit-check

Memory Cycle v1 — Walk-Forward Backtest

Headline

The mechanical rules in the v1 framing doc DRAMATICALLY underperform buy-and-hold on both names across the 2019-2025 window. The strategy is not overfit per-se — it's structurally broken.

Metric MU SMH
Walk-forward total return +109.34% +109.87%
Walk-forward Sharpe (per-fold-annual) 0.39 0.85
Max drawdown 16.1% 13.8%
Buy-and-hold same period +301.57% +245.06%
Delta vs buy-and-hold -192.23% -135.19%
Total trades 25 26

The strategy left ~190 percentage points of return on the table for MU and ~135 for SMH over 7 years. That is not a small overfit; the rules are systematically harmful.

Equity curve (per-fold)

Each fold starts fresh at $20k (2R worth of capital allocated to a single name).

MU

Test Yr Start End Strat % BH % Sharpe DD % Trades
2019 20000 20174 +0.87 +32.11 0.15 8.2 3
2020 20000 19224 -3.88 +17.86 -0.11 16.1 4
2021 20000 20103 +0.52 +13.05 0.14 3.1 2
2022 20000 17639 -11.81 -23.70 -0.83 16.0 4
2023 20000 21430 +7.15 +35.30 1.37 3.1 3
2024 20000 20954 +4.77 +1.32 1.29 2.9 3
2025 20000 43391 +116.95 +118.09 2.84 12.7 6

SMH

Test Yr Start End Strat % BH % Sharpe DD % Trades
2019 20000 23223 +16.12 +31.63 2.08 5.7 4
2020 20000 26369 +31.84 +26.01 1.42 13.8 5
2021 20000 21046 +5.23 +20.92 1.21 2.2 2
2022 20000 17599 -12.00 -17.48 -1.01 12.2 4
2023 20000 21459 +7.29 +37.36 2.17 1.4 3
2024 20000 21209 +6.04 +21.98 1.73 2.5 3
2025 20000 26024 +30.12 +24.44 1.65 11.5 5

Per-fold trade logs (MU)

2019 (DRAM cycle recovery year):

2020 (COVID year, set up the massive boom):

2021 (sideways year):

2022 (DRAM cycle crash):

2023 (DRAM cycle bottom + recovery):

2024 (sideways then weak):

2025 (AI/HBM boom year):

Parameter sensitivity (MU)

Sweep ±20% around each lockable parameter, all others held at default.

Parameter Base -20% -10% 0% (locked) +10% +20%
tranche_2_pullback_pct -5.0% 108.9% 109.3% 109.3% 107.7% 108.4%
tranche_3_pullback_pct -10.0% 102.6% 109.3% 109.3% 109.3% 111.2%
phase_marker_trigger_pct -15.0% 8.2% 7.8% 109.3% 109.3% 103.8%

(Cells show aggregate walk-forward total return %.)

The phase-marker trigger is a cliff. Tightening the exit threshold from -15% to -13.5% (a 10% adjustment) drops total return from +109% to +7.8%. That is not a smooth gradient — it's a discontinuity. The strategy lives on a knife-edge where any tightening of the exit causes it to fire prematurely on noise.

Tranche pullback parameters are robust within the swept range — they don't materially change outcomes because the strategy rarely gets all 3 tranches deployed before the phase-marker exit fires anyway.

"Is this overfit?" diagnostic

No — it's worse than overfit. It's structurally wrong for the thesis horizon.

Overfit would mean "great in-sample, bad out-of-sample." Here, the locked rules are bad EVERYWHERE. The strategy underperforms buy-and-hold in every single fold except 2022 (where it lost less in a down year) and 2025 (where it roughly matched). It doesn't matter that we held parameters fixed across folds — the rules themselves are misaligned with the thesis horizon.

The structural problem: the framing doc says "no per-trade stops" but then defines a phase-marker exit at 90d return < -15%, which IS a per-trade stop. It just wears a "phase marker" jacket. Look at the trades:

In 3 of 4 phase-marker exits, the strategy locked in losses or small gains while the underlying was 1-3 months away from a major rally. That is the classic momentum-stop trap on a multi-year thesis.

The framing doc DID anticipate this when it said: "Tight stops shake us out of multi-year theses on noise. Instead, the THESIS itself has a stop (the anchor-break condition)." But the implementation collapsed the anchor-break condition into a 90d price-momentum proxy because we don't have DRAM spot or hyperscaler capex feeds. That proxy is materially worse than no exit at all.

Anchor-break sensitivity / proxy disclosure

The thesis defines 3 phase markers (DRAM spot trend, hyperscaler capex direction, HBM cadence). None are available as free historical feeds. The backtest collapses all 3 into a SINGLE price-momentum proxy: MU's own 90d trailing return.

This is the most load-bearing caveat in the report. The proxy is fundamentally weaker than the original thesis because:

  1. Reflexivity bug. The real phase markers are fundamental data that lead price; the proxy IS price. Using price-derived signal to time price entries/exits is tautological and lossy.
  2. 2-of-3 confirmation lost. The original spec says "single phase marker flips bearish but other 2 hold → trim to 1R." With a single price proxy, the "2-of-3 confirmation" filter that would prevent premature exits is gone.
  3. Lead-time lost. DRAM spot prices and hyperscaler capex revisions are reported with lag but reflect supply/demand fundamentals. Price-momentum reacts to anything (rate fear, sentiment swings, macro shocks unrelated to memory).

A faithful test of the thesis as written REQUIRES real DRAM spot price data + hyperscaler capex revision data. Without those, this backtest is testing a degraded version of the strategy and the result understates what the thesis could deliver. But the price proxy is the same data we'd actually have at trade-time on a paper run if we don't build a phase-marker feed first, so the result is also a true upper bound on "if you literally run this strategy with no exotic data feeds."

What buy-and-hold tells us

The most striking finding is HOW MUCH money buy-and-hold left on the table for the strategy. Across both names, buy-hold beats the mechanical strategy by 50-100 percentage points on a per-fold basis, and 135-192 percentage points cumulative.

This is consistent with the academic literature on cyclicals (Asness, Marathon, Druckenmiller writings): the right play on a structural multi-year cycle is conviction-sized exposure held through volatility, NOT tactical adjustments that try to time within-cycle pullbacks. The strategy's tranche-accumulation logic is fine, but the exit logic shoots it in the foot.

Caveats

  1. Macro-cycle backtests have inherent overfit risk. 7 folds over 7 years is statistically thin. The 2025 fold (+117%) is so strong it skews aggregate stats; without 2025 the strategy is dramatically negative vs buy-hold (run a leave-one-out check before reading too much into the +109% aggregate).
  2. No transaction costs modeled. ~3-6 trades per fold × 7 folds × 2 tickers = ~50 trades. At $0 commission (Alpaca) and ~5bps spread on liquid names like MU/SMH, transaction friction is ~$2-5k cumulative across all folds — material but not dominant.
  3. No slippage modeled. Trades execute at daily close.
  4. DRAM spot data is a price-momentum proxy, not a real feed. Documented above. Most load-bearing caveat.
  5. Hyperscaler capex revisions and HBM cadence excluded entirely. The real 2-of-3 anchor confirmation logic is absent.
  6. 2017-2018 not used in test windows. Train period starts 2017; first test fold is 2019. We are missing the 2017-18 DRAM cycle top in test data.
  7. Yahoo Finance historical data, not point-in-time. Adjusted for splits/dividends as reported NOW. Survivorship bias is present (MU survived; the test universe is curated from today's vantage).
  8. No portfolio-level exposure cap. Each fold is run on a single name in isolation. Combined MU + SMH allocation in real deployment would have correlation effects not modeled.
  9. Tranche-2 and tranche-3 sometimes trigger on the same bar (e.g. 2025-04-03 MU: -14.8% gap, both T2 and T3 fire at the same price). Realistic but worth noting — the spec didn't anticipate gap-down opens.

Recommendation for paper deployment

ARCHIVE the v1 mechanical rules. ITERATE the strategy spec before paper deployment.

Specifically:

  1. Remove the phase-marker price-momentum proxy as an exit trigger. It is the single load-bearing source of underperformance. Until we have real DRAM-spot + capex-revision feeds, the exit logic should be: hold through the test window, exit only on fundamental thesis break (founder + Ray manual review, not a price rule).

  2. If you must have a mechanical exit on price data alone: consider a much wider trigger (>-30% trailing 90d, which only fires in true cyclical capitulations) AND require confirmation from a longer window (e.g. 6-month return < -25%). The current -15% / 90d is too jumpy.

  3. The tranche-accumulation logic is sound. Per-fold trade logs show T2/T3 entries firing at price points that subsequently produced 50%+ rallies (2020 COVID lows, 2025 April dip). The buy-the-dip portion of the strategy is value-additive; only the exit rule is broken.

  4. Build the real phase-marker feed before re-running. Quarterly DRAM contract pricing from TrendForce/DRAMeXchange (free summaries published in trade press), and hyperscaler quarterly capex guidance revisions from 10-Q filings. Both are cron-scrapable. This is the cheapest path to a thesis-faithful exit rule.

  5. In the meantime, the honest answer to "is the memory cycle thesis backtestable": YES, the THESIS is empirically supported (buy-and-hold MU 2019-2025 returned +302%, dominating SPY). But the STRATEGY spec in the framing doc materially underperforms the thesis. The capital-cycle reading is right; the execution rules are wrong.

Concrete next step: revise the framing doc to remove the price-momentum exit, re-run this backtest with HOLD-TO-FOLD-END semantics, and compare against buy-and-hold. If the only-tranche-entry version matches or modestly exceeds buy-hold (because dollar-cost-averaging into pullbacks at -5%/-10%/-15% beats a single-shot entry at the start of the window), the revised spec is paper-deploy-ready. If it merely matches buy-hold, then there's no strategy edge here and we should just buy-and-hold MU on a thesis-confirmed entry signal.

Files

Related