Quantitative Portfolio Strategy · OOS 2006–2026

Adaptive Macro Regime
Detection & ETF Rotation

Markets don't announce regime changes. By the time a recession is declared, portfolios are already down 20–40%. This project builds the early-warning system — reading 12 macro signals monthly to detect the shift before it hits prices, then rotating automatically.

0.937
Sharpe Ratio (OOS)
↑ +23% vs S&P 500
8.45%
Annual Return (CAGR)
241 months, 0 look-ahead
-21.0%
Max Drawdown
vs S&P 500's -50.8%
+3.4%
During 2008 GFC
S&P 500 lost -46%
Methodology

How It Works — Three Steps

No black boxes. Every decision is traceable to a data point.

📡
Step 1 · Read

Monitor the Economy

12 Federal Reserve (FRED) indicators updated monthly: yield curve shape, credit spreads, unemployment, inflation, industrial output, money supply, and more.

🧠
Step 2 · Classify

Detect the Regime

A 3-state Hidden Markov Model processes the signals and assigns probabilities: Expansion / Stagnation / Contraction. Output is probabilistic — not a binary switch.

⚖️
Step 3 · Rotate

Adjust the Portfolio

Probability-weighted allocation across 6 ETFs (stocks, bonds, gold, credit, cash). Rebalances only when drift exceeds 2% — minimising unnecessary transaction costs.

Target Allocation by Regime
Asset Expansion 📈 Stagnation ⚠️ Contraction 🛡️
SPY — US Stocks60%30%10%
TLT — Long Bonds10%25%40%
GLD — Gold5%15%25%
LQD — IG Credit15%15%5%
HYG — High Yield10%5%0%
BIL — Cash0%10%20%
Performance

20-Year Out-of-Sample Results

Trained on 1991–2005. Tested blind on 2006–2026 — including three major crises.

The deliberate trade-off: SPY earned more in absolute dollars — $779 vs $510 on $100 invested. The strategy traded ~2% of annual return for 60% less drawdown, faster recovery, and +3.4% during the 2008 financial crisis while SPY fell 46%. That's not underperformance — it's a different objective function.

Growth of $100 — 2006 to 2026
Regime Strategy → $510 S&P 500 → $779 60/40 → $494 Equal Weight → $344 GFC 2008–09: Strategy stayed flat while SPY fell 50%
Strategy CAGR Volatility Max Loss Sharpe Sortino Recovery
Regime Strategy
8.45% 9.13% -21.0% 0.937 1.357 31 mo
S&P 500 Buy & Hold
10.56% 14.70% -50.8% 0.760 1.050 57 mo
60/40 Portfolio
8.56% 9.81% -28.5% 0.890 1.115 35 mo
Equal Weight
6.32% 7.09% -16.9% 0.902 1.298 29 mo
The Compounding Math — Why Drawdown Matters More Than Return
Regime Strategy
-21%
needs +27% to recover
60/40 Portfolio
-29%
needs +41% to recover
S&P 500
-50.8%
needs +103% to recover

A portfolio that drops 50% spends years just getting back to flat — not compounding. Every year in recovery is a year of missed growth. Avoiding catastrophic drawdowns is a return strategy.

Honest Caveat (Statistical Test): A block bootstrap test (1,000 simulations) gives p=0.434 — meaning we can't statistically prove the strategy beats the S&P 500 at 95% confidence over this period. This is expected: 20 years of monthly data is rarely enough to reach statistical significance for any individual strategy. The 95% confidence interval for Sharpe is [0.32, 1.17] — the lower bound is solidly positive. The crisis track record and risk-adjusted metrics tell the real story.
Stress Test

How It Behaved in Real Crises

The model never saw these crises during training. These are genuine out-of-sample results.

🏦 2008 Global Financial Crisis
Oct 2007 – Mar 2009
Regime Strategy +3.4%
S&P 500 -46.0%
60/40 -22.6%
Capital fully preserved
🦠 COVID Crash
Feb – Apr 2020
Regime Strategy -4.4%
S&P 500 -9.2%
60/40 +0.6%
Half the loss of SPY
📈 2022 Rate Shock
Jan – Dec 2022
Regime Strategy -16.3%
S&P 500 -18.2%
60/40 -23.4%
Beat SPY & crushed 60/40
🇪🇺 EU Debt Crisis
2011 – 2012
Regime Strategy +13.4%
S&P 500 +8.7%
60/40 +20.8%
Outperformed SPY
⚡ Taper Tantrum
May – Sep 2013
Regime Strategy -2.3%
S&P 500 +6.3%
60/40 -1.5%
Cautious — gave up some upside
📊 Summary Score
Won decisively: 2 / 5
Better than SPY: 4 / 5
Worst crisis (2008): +3.4% vs -46%
Biggest miss: Taper Tantrum
Protected in every major downturn
The Signal Engine

What the Model Reads

12 publicly available government data series from the US Federal Reserve. No proprietary data needed.

📉

Yield Curve Shape

10Y minus 2Y Treasury spread. Inversion has predicted every US recession since 1970 — typically 12–18 months early. The single most predictive feature.

💳

Credit Spread (BAA)

Extra yield on corporate vs government bonds. Widens sharply when fear rises — credit markets flash red before equities react.

💼

Employment Signals

Unemployment rate (monthly) + initial jobless claims (weekly). Claims spike fast at turning points — early warning before unemployment data confirms.

🏭

Industrial Output & GDP

Industrial production (monthly) and real GDP YoY (quarterly, ALFRED vintage). Uses numbers as published — no revision bias.

🔥

Inflation (CPI)

High CPI locks the Fed into hiking even as growth stalls — the stagflation trap. 2022 is the textbook case: stocks and bonds fell simultaneously.

🏦

Fed Funds & Money Supply

Policy rate stance and M2 growth. Aggressive hiking cycles precede every major recession; M2 contraction (rare) signals severe credit tightening.

Risk-Adjusted Performance

Beyond Simple Return

Return alone is incomplete. These metrics show the quality of the return.

Sharpe Ratio
0.937
vs SPY 0.760 · +23%
Sortino Ratio
1.357
vs SPY 1.050 · +29%
Calmar Ratio
0.402
vs SPY 0.208 · +93%
Omega Ratio
2.053
vs SPY 1.746 · +18%
Max Drawdown
-21.0%
vs SPY -50.8% · 60% less
Recovery Time
31 mo
vs SPY 57 months · 1.8× faster
What Each Metric Tests
Sharpe: Return per unit of total risk. Standard measure at every fund.
Sortino: Return per unit of downside risk only. Better for protection strategies.
Calmar: Return per unit of worst-case loss. CIO/trustee metric.
Omega: Ratio of all gains to all losses. Captures full return distribution.
Robustness — 108 Configurations Tested
K states tested: 2, 3, 4
Training windows: 10, 15, 20 years
Transaction costs: 0 → 30 bps
Rebalance bands: 0%, 2%, 5%
Signal is robust across all K values and cost assumptions. TC is the dominant sensitivity — strategy survives up to ~20bps.
Bottom Line

Why This Matters

Most portfolios are built for one regime and left to survive all others. This project builds a system that reads the economic environment monthly and adjusts exposure accordingly — the same logic that institutional allocators apply with full research teams, automated from public data alone.

60%
Less drawdown than SPY
+3.4%
During 2008 (SPY −46%)
0.937
Sharpe — 23% above SPY

The goal was never to beat SPY in a bull market. It was to build something that holds up when it matters most — and to prove it on 20 years of out-of-sample data, not a backfit curve.


↑ Back to top