Rotation & the credit gate — research & 20-year backtest (Jun 2026, corrected Sep 2026)
Versioned source evidence · docs/ROTATION_CREDIT_RESEARCH.md
SHA-256: 8ce31a27764d6494efae7808ae1a6ae5768444a9228f9e9c90758aa5c7cefbe7
Original source text. A superseded report retains its original assertions; it does not replace a corrected finding. Reproduction code is displayed without execution.
# Rotation & the credit gate — research & 20-year backtest (Jun 2026, corrected Sep 2026)
> **⚠️ Corrected Sep 2026 — three independent errors, pointing in opposite
> directions**, which is why they cancelled in the headline for years and none was
> caught.
>
> 1. **A stale-stamping bug in the bond sleeve** made the strategy look like a
> buy-hold-beater. Week `w` of the defensive leg was stamped with IEF's return
> over `(w-1, w]` — a return the rate-regime gate had *already observed* when it
> decided to be on. Worth a spurious **+2.7pp of CAGR / +0.24 Sharpe**.
> 2. **The panel is price-only** (unadjusted closes), which silently drops IEF's
> ~2.7%/yr of coupon and SPY's ~2.0%/yr of dividends — understating every level
> by ~2pp.
> 3. **The cash leg booked 0.0%.** While rates *rise* the de-risked fraction sits in
> cash, and cash was modelled as banknotes rather than bills — a one-sided
> penalty on ~48% of weeks that the SPY benchmark never paid. Worth **~0.4pp**
> here (mean 13-week bill 1.72%), and far more in a high-rate era.
> 4. **The credit read was used before it was published.** NFCI is released
> Wednesday covering the prior Friday (measured — see
> [NFCI publication lag](#-open-threat-to-the-corrected-result--nfci-publication-lag)),
> so sizing week `w` on the print dated Friday `w` was a ~5-day look-ahead.
> Worth **~0.74pp**.
>
> Correcting all four, the honest 20-year figure at **tradeable timing** is:
>
> | | CAGR | Sharpe | maxDD |
> |---|---:|---:|---:|
> | **`stovall_credit_bonds`** | **10.30%** | **1.16** | **−12.7%** |
> | `index_credit_bonds` | 10.08% | 1.18 | −13.5% |
> | SPY buy & hold | 11.08% | 0.68 | −54.6% |
>
> So it lands **0.8pp below the index at a quarter of the drawdown** — a
> risk-control overlay, not alpha. The originally published *11.1% / 1.22* landed
> near the right CAGR by accident (two errors up, two down) while claiming **+259%
> alpha over SPY**, which is false on every basis.
>
> Independently corroborated: the 54-year study (PR #558) hit all of errors 1, 3
> and 4, and lands in the same place at tradeable timing — **10.4% / 1.17 /
> −26.8%** against a market base of 11.2% / 0.72 / −54.0%. Two windows, two
> codebases: 10.30 vs 10.4 CAGR, 1.16 vs 1.17 Sharpe.
>
> Full account: [Defensive-leg alignment](#defensive-leg-alignment--a-one-week-look-ahead-corrected-sep-2026)
> and [Price-return basis](#price-return-basis--the-levels-are-understated-both-arms).
> Tables elsewhere in this file are price-only unless marked otherwise, because that
> is what the app's own engine computes.
The strategy this investigation kept: **`stovall_credit_bonds`** — Stovall sector
rotation with exposure scaled down by credit stress, the de-risked fraction routed
into Treasuries when rates are falling. It does **not** beat SPY on return over a
full 20-year, crisis-inclusive window; it roughly quarters the drawdown for about
the same money. This documents how we got there: which macro/rotation strategies
were tested, why the obvious ones fail out of sample, and what the credit gate is
actually worth.
Harness: [`app/scoring/rotation_strategies.py`](../backend/app/scoring/rotation_strategies.py)
(`compare_rotation_strategies(years=N)`), weekly rebalance, signal@close →
fill@next-week, transaction costs charged on turnover. Numbers below are the
in-app comparison over **~19.9y (1,036 weeks, 2006-08→2026-06)** against the DB seeded
by [`backfill_sector_history.py`](../scripts/backfill_sector_history.py) +
[`backfill_credit_inputs.py`](../scripts/backfill_credit_inputs.py).
## TL;DR
- **No standalone macro/rotation signal beats SPY over 20y** — and, post-
correction, neither does the credit-gated one. Plain Stovall
rotation, sector momentum, Fear & Greed, capital-rotation breadth, and net
liquidity are all signal-only or drawdown tools — none is a buy-hold-beating
return engine on its own.
- **The classic window trap:** Stovall sector rotation *wins* over 5y (+48%
alpha) but *loses* over 20y (−31% alpha, −61% max drawdown). The 5-year window
excludes 2008 — the edge was a regime artifact, not alpha.
- **The credit gate is the keeper — as risk control, not alpha.** Scaling
Stovall's exposure by a trailing percentile of **credit stress** (Chicago Fed
`NFCICREDIT`) and routing the de-risked sleeve into **IEF when the 10y yield is
falling** (flight-to-quality) vs **cash when rising** (a rate-hike bear like
2022) produces `stovall_credit_bonds`:
| strategy (19.9y, 1,036 wks, 5 bps) | CAGR | Sharpe | maxDD | Calmar | alpha vs SPY |
|---|---:|---:|---:|---:|---:|
| **index_credit_bonds** (SPY base) | **8.7%** | **1.03** | **−13.4%** | **0.65** | **−47%** |
| **stovall_credit_bonds** | **8.5%** | **0.98** | **−12.8%** | **0.67** | **−60%** |
| stovall_credit_scaled (→ cash) | 7.5% | 0.90 | −14.8% | 0.51 | −150% |
| stovall_credit_regime (+200dma) | 6.3% | 0.78 | −17.2% | 0.36 | −234% |
| stovall (plain) | 8.8% | 0.55 | −60.8% | 0.14 | −32% |
| SPY buy & hold | 9.1% | 0.58 | ~−55% | ~0.17 | — |
It **trails SPY slightly on return** (8.5% vs 9.1% CAGR) and wins decisively on
risk: **Sharpe 0.98 vs 0.58 at roughly a quarter the drawdown**, net green
through 2008 / 2020 / 2022, and it holds in walk-forward. That is a real and
useful property — it is just *drawdown control*, not excess return. Before the
Sep-2026 alignment fix this table read 11.1% / 1.22 / +259% alpha and the
strategy looked like a buy-hold-beater; it never was.
These levels are on the app's **price-only** panel. On a total-return basis at
tradeable timing the same run is **10.30% / 1.16 / −12.7%** against SPY's
**11.08% / 0.68 / −54.6%** — 0.8pp below the index at a quarter of the drawdown,
which is the honest way to state the result. See
[Price-return basis](#price-return-basis--the-levels-are-understated-both-arms)
and [The cash leg earns bills, not zero](#the-cash-leg-earns-bills-not-zero).
- **The return comes from bond *carry*, not the credit gate.** On total-return data,
always holding the defensive sleeve in bonds earns **11.00% / Sharpe 1.19 /
−15.3%**; adding the rate-regime gate gives **10.62% / 1.20 / −12.1%**. The gate
spends ~0.4pp of return to buy ~3pp of drawdown and leaves Sharpe flat. It is a
risk control, not a return engine — and the stale-stamping bug is precisely what
used to make it look like one.
- **De-risk-into-bonds (not cash) + the rate-regime switch still earn their
place, but by much less.** The →cash version (`stovall_credit_scaled`, Sharpe
0.90) is barely behind the bond version (0.98); pre-correction the gap looked
like 0.89 → 1.22. Most of what the bond sleeve appeared to add was the
look-ahead. The rate switch is still what stops the sleeve from blowing up in
2022's rate-hike bear.
## The strategies tested (and why the obvious ones fail)
| Strategy | Verdict over 20y |
|---|---|
| **Stovall sector rotation** (hold the stage's leader sectors) | Wins 5y (+48% alpha), **loses 20y** (−31% alpha, −61% DD). Window trap. |
| Cross-sectional sector momentum (rel / abs / dual / accel) | ≈ buy-hold, no durable edge. |
| **Fear & Greed** (contrarian) | Real but modest contrarian IC (~−0.09), OOS-stable; underperforms as a return engine. See [`FEAR_GREED_RESEARCH.md`](FEAR_GREED_RESEARCH.md). |
| **Capital-rotation breadth** (`bear_count`) | Real OOS IC but signal-only. |
| **Net liquidity** (WALCL − TGA − RRP, rising/accelerating = risk-on) | Weak confirmer; cuts drawdown, doesn't add return. |
| **Stovall × credit gate** | ✅ The keeper — a drawdown overlay, not a return engine. Below. |
The recurring lesson across all of them: **these signals are drawdown / regime
tools, not standalone alpha.** Value comes from using one as an *exposure
overlay* on a sensible base (Stovall's sector selection), not from trading the
signal directly.
## The keeper — `stovall_credit_bonds`, mechanism
1. **Stovall picks *which*** — hold the leader sectors for the current Stovall
market stage (the base policy, unchanged).
2. **Credit stress scales *how much*** — exposure = `1 − trailing-percentile(NFCICREDIT)`
over a 156-week window (self-normalising across regimes). Rising credit
stress → trim equity.
3. **The de-risked fraction is routed by the rate regime** — into **IEF**
(7–10y Treasuries) when the 10y yield (`DGS10`) is below its 26-week average
(rates falling → flight-to-quality pays in a credit crash), otherwise to
**cash** (a rate-hike bear, where bonds don't hedge — this is the fix for
2022).
Registered via a backward-compatible `defensive_return_by_week` argument to
`_simulate` (default `None` = cash). `_credit_scaled_panels` builds the exposure
+ defensive-return panels; returns `None` (overlay silently skipped) when the
FRED/IEF inputs aren't cached. Both panels are stamped by *rebalance week* and
consumed against the `w → w+1` interval — see
[Defensive-leg alignment](#defensive-leg-alignment--a-one-week-look-ahead-corrected-sep-2026)
for why that alignment is load-bearing.
### Hardening / robustness (before sizing up)
A full pre-deployment stress pass — reproducible via
[`scripts/harden_stovall_credit_bonds.py`](../scripts/harden_stovall_credit_bonds.py)
(point `DATABASE_URL` at a seeded DB). It clears every dimension:
All figures re-measured Sep 2026 after the alignment fix (10 bps/side).
**1. Window-length — beats SPY's Sharpe at every lookback from 5y out; loses at 3y.**
| lookback | 3y | 5y | 7y | 10y | 12y | 15y | 20y |
|---|---|---|---|---|---|---|---|
| credit-bonds Sharpe | 1.20 | 1.03 | 1.29 | 1.05 | 0.95 | 1.02 | 0.89 |
| SPY Sharpe | 1.30 | 0.72 | 0.82 | 0.81 | 0.76 | 0.85 | 0.58 |
| beats SPY? | **no** | yes | yes | yes | yes | yes | yes |
maxDD stays −11 to −13% throughout. Plain Stovall *fails* this test differently —
it beats SPY at 5y but loses at 20y (0.55 vs 0.58). The gate is not window-fitted,
but the 3y column is a genuine miss: in a quiet, strongly trending tape a
permanently half-invested book cannot keep up. (Pre-correction this row read
1.43 / 1.33 / 1.51 / 1.27 / 1.28 / 1.17 / 1.13 and beat SPY everywhere.)
**2. Walk-forward (disjoint ~5y eras) — wins risk-adjusted in three of four.**
| era | credit-bonds Sharpe / maxDD | SPY Sharpe / maxDD |
|---|---|---|
| 2006–11 (GFC) | 0.85 / −12% | 0.14 / −56% |
| 2011–16 | **0.57 / −10%** | **0.73 / −16%** |
| 2016–21 (COVID) | 1.00 / −13% | 0.86 / −32% |
| 2021–26 (’22 bear) | 1.15 / −11% | 0.80 / −25% |
It loses the placid 2011–16 era outright (0.57 vs 0.73) and trails on raw return
in both bull eras (+53% vs SPY +100% into 2021); in the crisis eras it wins
decisively. Crisis peak-to-trough: **GFC +14% (−9% DD) vs SPY −40% (−56%);
COVID +9% (−3%) vs −10% (−32%); 2022 −2% (−3%) vs −18% (−23%)** — the gate
de-risks exactly when it matters, which is the whole of its value.
**3. Parameter plateau — Sharpe 0.83–1.04 across the whole grid; still a plateau,
not a spike, and the defaults are off-peak.**
- Credit-percentile window 78→208w: Sharpe 0.89–1.04 (shorter is marginally
better; the 156w default sits at 0.89, *not* the peak).
- Rate-regime MA 13→52w: 0.83–0.89.
- Cost: beats SPY's 0.58 up to ~20 bps/side (0.72); at 30 bps it falls to 0.54 and
loses. Realistic sector-ETF cost (5–10 bps) gives 0.89–0.98.
**Verdict:** robust to knob choice and realistic cost, and its crisis behaviour is
unchanged — but it is *not* a return engine, and it is beatable by SPY in short,
calm windows. Size it as drawdown insurance. The original caveats (one universe, one 20-year sample) have
since been tested on both axes and the overlay holds on each:
> **⚠️ Both corroborations below share the alignment bug and their headline
> figures are stale.** Each runs its own copy of the overlay formula, and each
> pairs the defensive leg with the same week that produced the gate reading. The
> production engine is fixed; these two research scripts are **not**, and their
> numbers are quoted here only as the pre-correction record. Re-running them is
> the open follow-up.
- **Across markets** ([`OUT_OF_SAMPLE_CREDIT_GATE.md`](OUT_OF_SAMPLE_CREDIT_GATE.md)),
**re-measured (PR #561)**: on a developed-market country rotation (25.8y) and a
European STOXX-600 sector rotation (18.8y) the gate cuts drawdown from −58.7% to
−20.7% and −50.0% to −15.9%, wins all four disjoint walk-forward halves and every
crisis window. Sharpe lift is **+0.40 / +0.47**, not the +0.63 / +0.79 published.
The old claim that the EU overlay "almost exactly reproduces" the US result is
**false** — EU 0.90 vs US 1.24. The gate transfers as *drawdown control*; it does
not work equally well abroad.
- **Across time** ([`LONG_HISTORY_CREDIT_GATE.md`](LONG_HISTORY_CREDIT_GATE.md)):
on long-history *index* data (Fama-French, 1971→2026) the overlay runs **54.5
years**. Published as Sharpe 0.72 → 1.41, maxDD −54% → −19%, $1→$681.
**Measured here with the gate properly lagged** (both `expo` and `falling` by
one week, since that script stamps week `w` with the `(w-1, w]` return):
**CAGR 12.7% → 9.3%, Sharpe 1.41 → 1.06, maxDD −19.2% → −26.4%, $681 → $127** —
the overlay now *trails* the 11.2% market base on return, exactly as in the
20-year production window. Its per-decade and per-crisis de-risking survives.
That script is left untouched here; the doc is a separate follow-up.
The gate's *risk* behaviour generalises across markets and five decades. Its
apparent return advantage did not survive the alignment audit in either place it
has been checked.
## Defensive-leg alignment — a one-week look-ahead (corrected Sep 2026)
Every headline in this file used to be ~2.7pp of CAGR too high. The cause was a
one-week misalignment in the **defensive leg only**; the equity leg was always
correctly lagged.
> **Terminology.** "Look-ahead" is loose here and a skeptic will say so: the
> pre-fix code uses no future data — IEF's return over `(w-1, w]` is fully known at
> `w`. The defect is **stale stamping with selection on an already-realized
> return**: an old return is booked against capital that was not yet parked, and
> the gate choosing to park it had already seen that return. It behaves exactly
> like a one-week look-ahead, which is why the shorthand stuck, but state it the
> precise way when it matters.
### The bug
`_credit_scaled_panels` built the bond sleeve's weekly return with
```python
iefw = close["IEF"].resample("W-FRI").last().reindex(
common, method="ffill").pct_change().fillna(0.0) # <- stamps (w-1, w] at w
defret = iefw.where(falling, 0.0)
```
so `iefw[w]` is IEF's return over `(w-1, w]`. `_simulate` then books
`defensive_return_by_week[week_start]` against the `week_start → week_end`
interval — the week the capital is actually parked. The de-risked fraction was
therefore paid the **previous** week's bond return.
Fix: `.pct_change().shift(-1)`, so week `w` earns `(w, w+1]`. The `falling` gate
stays stamped at `w` — the routing decision is still made with week-`w`
information, so no lag is removed, only a look-ahead.
### Why it flattered the strategy so much
The naive expectation is a small timing wash. It was not, because `falling` is a
**backward-looking** condition: "the 10y sits below its 26-week average as of `w`"
is a statement that yields have been falling — that bonds have *already rallied* —
for some weeks up to `w`. It therefore predicts IEF's past returns strongly and its
future returns barely at all:
| conditional expectation | value |
|---|---|
| `E[IEF weekly]` unconditional | **+0.018%/wk** (+0.9%/yr) |
| `E[IEF (w-1, w] \| falling@w]` — booked by the stale leg | **+0.224%/wk** |
| `E[IEF (w, w+1] \| falling@w]` — actually earned | **+0.046%/wk** |
Booking the sleeve one week late paid it exactly the backward returns the gate was
measuring. De-risk-weighted, the sleeve contributed **+3.53%/yr as booked vs
+1.00%/yr as earned — overstated by 2.53%/yr**, of which the rate-gate selection is
+2.53pp and the credit-exposure weighting only +0.10pp. The *rate-regime switch*,
not the credit gate, was doing the cheating.
An earlier draft of this section blamed a same-*week* coincidence (`falling[w]`
being set by the move during `(w-1, w]`). The lag sweep below refutes that
sharpening: the excess is a **plateau across every backward shift**, not a spike at
one. The gate is simply a trend filter with no forward edge.
### Ruling out a level effect (this is alignment, not dividends)
Every row below uses the *same* IEF series; only the alignment moves. A property of
the series — missing distributions, a splice, any level effect — would have to show
up at every shift and survive removing the gate. Neither happens.
| shift | books for week `w` | `E[IEF \| gate]` | sleeve/yr |
|---|---|---:|---:|
| +2 | `(w-3, w-2]` three weeks stale | 0.208% | 3.47% |
| +1 | `(w-2, w-1]` two weeks stale | 0.202% | 3.27% |
| **0** | `(w-1, w]` **stale (pre-fix)** | **0.224%** | **3.53%** |
| **−1** | `(w, w+1]` **correct (the fix)** | **0.046%** | **1.00%** |
| −2 | `(w+1, w+2]` one week into the future | 0.056% | 1.08% |
| −3 | `(w+2, w+3]` two weeks into the future | 0.025% | 0.57% |
**Gate placebo** — pay the bond return in *every* week, no rate gate: stale
**+0.96%/yr** vs correct **+0.89%/yr**. The gap **collapses from ~253bp to ~8bp**
(the residue is `cov(de-risked fraction, IEF)`, not a level effect) — on the
total-return panel, +2.30% vs +2.22%, the same ~8bp. Any property of the IEF series
itself, dividends included, would appear here at full size. It does not.
**Shuffled-gate placebo** — 200 circular shifts of the gate: the stale arm scores
+3.53%/yr against a +0.49% placebo mean (**z = +5.2**); the corrected arm scores
+1.00% against +0.55% (**z = +0.8**, i.e. noise). The stale arm's edge exists only
while the gate keeps its own timing.
**And on a dividend-adjusted panel the delta is unchanged** — −2.76pp CAGR /
−0.23 Sharpe, versus −2.74pp / −0.24 price-only (see
[Price-return basis](#price-return-basis--the-levels-are-understated-both-arms)).
Dividends move both arms together; they cannot move the gap.
**The mechanism, demonstrated directly.** Take the *honest* forward bond return and
instead let the **gate** peek one week ahead (`falling.shift(-1)`). That
reconstructs the pre-fix result almost exactly:
| | CAGR | Sharpe | maxDD |
|---|---:|---:|---:|
| pre-fix (stale return + contemporaneous gate) | 11.26% | 1.22 | −13.0% |
| honest forward return + **one-week-look-ahead gate** | **11.20%** | **1.27** | −12.7% |
| corrected (honest return + honest gate) | 8.51% | 0.98 | −12.8% |
(total-return panel: 13.38% / 1.43 vs 13.32% / 1.49 vs 10.62% / 1.20 — same story).
The pre-fix number *is* the gate peeking. Nothing about carry, income or the bond
sleeve reproduces it.
### Impact (20y, 1,036 weeks, 5 bps; SPY 9.12% CAGR / 0.58 Sharpe)
| strategy | stale (as published) | corrected | Δ |
|---|---|---|---|
| `stovall_credit_bonds` | 11.26% / 1.22 / −13.0% | **8.51% / 0.98 / −12.8%** | −2.74pp / −0.24 / +0.2pp |
| `index_credit_bonds` | 11.39% / 1.27 / −13.4% | **8.65% / 1.03 / −13.4%** | −2.74pp / −0.24 / −0.0pp |
| `stovall_credit_regime` ⚠️ **worst hit** | 9.86% / 1.16 / −15.0% | **6.27% / 0.78 / −17.2%** | −3.58pp / −0.38 / −2.1pp |
| `stovall_credit_scaled` (→ cash) | 7.46% / 0.90 / −14.8% | 7.46% / 0.90 / −14.8% | unchanged ✓ |
| `stovall` (plain) | 8.81% / 0.55 / −60.8% | 8.81% / 0.55 / −60.8% | unchanged ✓ |
`stovall_composite_bonds` shares the same `defret` map and is affected identically;
it is absent from this table only because the composite-snapshot history needed to
build it is not in the research DB. `stovall_credit_regime` is the **worst**-hit
strategy (−3.58pp), not `stovall_credit_bonds` — anything quoting it needs the same
correction.
The two cash-sleeve controls are bit-identical either way, which is the check that
the delta is the bond leg and nothing else. **Drawdown is essentially unaffected**
— the gate still de-risks into the same crises — so what the bug inflated was
purely the *return* of the parked capital.
The conclusion that changes: `stovall_credit_bonds` no longer beats SPY on return
(8.5% vs 9.1% CAGR, cumulative alpha −60%). It beats SPY on Sharpe (0.98 vs 0.58)
at about a quarter of the drawdown. That is drawdown insurance, not alpha — and it
matches what the independent credit+flow sleeve study concluded on its own terms
("half the drawdown for about the same return").
### Price-return basis — the levels are understated (both arms)
Separate issue, found while auditing the above, and it cuts the *other* way. The
rotation panel is **price-only**: `app/sources/rotation.py` downloads with
`auto_adjust=False` and stores the raw `Close`, so no distribution is ever
reinvested. Over this window that costs
| | price-only | total-return | distributions |
|---|---:|---:|---:|
| IEF | +0.71%/yr | +3.36%/yr | **+2.65%/yr** |
| SPY | +9.16%/yr | +11.12%/yr | +1.96%/yr |
(Window-specific, not a property of the series — over the full DB span it is
~3.00%/yr for IEF and ~1.87%/yr for SPY. CAGRs throughout this file annualise as
`weeks / 52` on 1,036 weeks = 19.92y; annualising over the calendar span instead
shifts the digits ~0.05pp.)
IEF is almost *entirely* coupon: on a price basis the defensive sleeve looks like
it earns nothing, because on a price basis it nearly doesn't. Re-running the same
engine on a dividend-adjusted panel:
| strategy (20y, 5 bps) | price-only | total-return |
|---|---|---|
| `stovall_credit_bonds` (corrected) | 8.51% / 0.98 / −12.8% | **10.62% / 1.20 / −12.1%** |
| `index_credit_bonds` (corrected) | 8.65% / 1.03 / −13.4% | **10.45% / 1.23 / −13.0%** |
| `stovall_credit_scaled` (→ cash) | 7.46% / 0.90 / −14.8% | 8.63% / 1.02 / −14.2% |
| `stovall` (plain) | 8.81% / 0.55 / −60.8% | 11.58% / 0.69 / −58.2% |
| SPY buy & hold | 9.12% / 0.58 | **11.08% / 0.68** |
Three things follow:
1. **The alignment delta is untouched** — −2.76pp CAGR / −0.23 Sharpe on the
dividend-adjusted panel vs −2.74pp / −0.24 price-only. The look-ahead and the
missing dividends are orthogonal; neither explains the other.
2. **The headline comparison survives the change of basis.** Corrected
`stovall_credit_bonds` earns 10.62% against SPY's 11.08% — still trailing on
return, still far ahead on risk (Sharpe 1.20 vs 0.68). "Drawdown control, not
excess return" holds on both bases.
3. **But price-only systematically penalises the bond sleeve** more than anything
else in the book, because IEF's return is ~79% coupon while SPY's is ~18%. Any
bonds-vs-cash comparison run on this panel is biased against bonds.
### The cash leg earns bills, not zero
**This was live in the shipped strategy, not just its comparator.**
`_credit_scaled_panels` routed the de-risked fraction to `0.0` whenever rates were
rising — ~48% of weeks, on ~half the book — while the SPY benchmark was never
charged anything equivalent. Nobody holds banknotes; that leg is a money-market or
bill position. **Fixed:** it now earns the 13-week T-bill (`DTB3`), which is seeded
by `backfill_credit_inputs.py` and *optional* — without it the leg falls back to
0.0, i.e. the previous behaviour, so a DB that never seeded it keeps working rather
than hiding the strategies.
| | price-only | total return |
|---|---|---|
| `stovall_credit_bonds`, cash leg at 0.0% | 8.51% / 0.98 | 10.62% / 1.20 |
| **`stovall_credit_bonds`, cash leg at bills** | **8.93% / 1.02** | **11.04% / 1.24** |
| `index_credit_bonds`, cash leg at bills | 9.07% / 1.08 | 10.88% / 1.27 |
Worth **+0.42pp/yr** over 2006–2026 at a mean bill rate of 1.72%. The 54-year study
found the same error worth ~1.5pp/yr, because its window contains the 10–15% bill
era — so the size of this one is entirely window-dependent, and any older study
that books 0% cash is understated much more than this.
### How much is the bond sleeve actually worth?
Careful here — `stovall_credit_scaled`, the "→ cash" comparator, *still* passes no
`defensive_return_by_week` at all, so its de-risked half earns a literal **0.0%**,
not a T-bill. Comparing against it overstates the bond sleeve. (Giving that variant
a bill leg too is a separate change — it would move every `→ cash` strategy in the
comparison table.) Paying the de-risked
fraction the 13-week T-bill instead (`DTB3`, mean 1.57%/yr over the window), on the
total-return panel with correct alignment:
| defensive sleeve | CAGR | Sharpe | maxDD |
|---|---:|---:|---:|
| **gated → bonds** (shipped) | **10.62%** | **1.20** | **−12.1%** |
| always bonds, no rate gate | 11.00% | 1.19 | −15.3% |
| cash at 13-week T-bill | 9.57% | 1.13 | −14.2% |
| cash at 0% (`stovall_credit_scaled`) | 8.63% | 1.02 | −14.2% |
Two corrections to the earlier draft of this file fall out:
- **Bonds over a realistic cash sleeve is +1.05pp of CAGR and +0.07 of Sharpe** —
not the +1.99pp / +0.17 you get against a 0% comparator. The part that is
genuinely bond-specific and survives scrutiny is the **−2.1pp of drawdown**.
- **The rate-regime gate is still not a return source, but it is no longer
return-*negative*.** With the cash leg at 0% the gate looked worse than always
holding bonds (10.62% vs 11.00%); with the bill leg it edges ahead
(**11.04% vs 11.00%**) at 3.2pp less drawdown and +0.05 Sharpe. That earlier
"always-bonds out-earns the gate" reading was an artifact of the 0% cash leg —
retracted. The honest statement: **the switch is roughly return-neutral and buys
drawdown**, which is also what the 54-year study concludes independently.
### ⚠️ The 20-year window excludes the one crisis the gate can't handle
The headline window starts **Aug-2006**, bounded by SPDR sector-ETF history — so it
contains 2008, 2020 and 2022 and **not** the 2000–02 dot-com bear. That is not a
neutral omission. Extending the same corrected engine back to 1999 roughly *doubles*
the drawdown, −13.9% → **−27.3%**, and every bit of the increase is one episode:
| crisis | SPY | gate | gate's avg equity exposure |
|---|---:|---:|---:|
| **Dot-com 2000–02** | −47.4% | **−25.6%** | **32%** |
| GFC 2007–09 | −55.9% | −8.1% | 7% |
| COVID 2020 | −32.2% | −2.5% | 7% |
| Rate bear 2022 | −23.4% | −5.7% | 19% |
**The gate barely fired through dot-com** — 32% average equity exposure against 7%
in the GFC and COVID. The mechanism is exactly what the strategy says it is: it
sizes off *credit stress*, and the dot-com unwind was an equity de-rating that did
not produce a credit event until much later. A gate keyed to `NFCICREDIT` cannot see
a valuation collapse that never reaches the credit market.
So the honest statement of what this buys is narrower than "halves drawdowns":
**it protects against credit crises, and it does not protect against equity
de-ratings.** Two of the three crises in the headline window are credit events,
which is why the window flatters it.
**Confirmed on 13 windows.** The 54-year study (PR #574) re-measured the same
quantity across its full crisis panel — my 32% / 7% for dot-com / GFC reproduces
there at **31% / 4%** — and with thirteen episodes the split is total, sorted by
average equity held:
| avg equity held | crises | credit event? |
|---|---|---|
| 77 / 67 / 61 / 39% | Tariff 2025, EU debt 2011, Q4 2018, Black Monday | **no** |
| 31 / 31% | **Dot-com, 1973–74** | **no** |
| 23 / 21 / 16% | COVID, 2022, Volcker | partly |
| 4 / 4 / 1 / 0% | 1990, **GFC**, China/oil, LTCM | **yes** |
The four most-invested are all non-credit; the four least-invested are all credit;
**no exceptions in thirteen.** So this is not a dot-com quirk — the gate protects
*in proportion to how much the drawdown is a credit event*, which is the design
rather than a caveat, since exposure is literally `1 − percentile(NFCICREDIT)`.
Two things follow that neither window showed alone:
- **Dot-com and 1973–74 land together at 31%** — a valuation de-rating and an
inflation shock, the two deepest non-credit drawdowns in the sample, and the gate
rode about a third of both. The 20-year window contains the first and not the
second; with both in view "not a credit event" is clearly the shared cause.
- **The 2010s are the thinnest decade in the 54-year Sharpe table** (0.95 → 1.01).
That is the same fact from the other side: no credit event in the decade, no
lift. A falsifiable prediction the existing table already satisfied, and which
both studies had read past.
This also settles the argument in [`NEGATIVE_FINDINGS`](NEGATIVE_FINDINGS.md) #7
that the 20-year shortfall is *"a melt-up artifact — over the full 1999–2026 cycle
the gate beats SPY on both Sharpe (0.98 vs 0.45) and CAGR (8.6% vs 6.5%)"*. That was
computed pre-correction. Re-measured on the corrected engine over the same
1999–2026 cycle:
| 1999→2026, price-only (the basis #7 used) | CAGR | Sharpe | maxDD |
|---|---:|---:|---:|
| SPY buy & hold | 6.53% | 0.45 | −55.9% |
| `index_credit_bonds` | **6.46%** | **0.78** | −27.3% |
| `stovall_credit_bonds` | 6.03% | 0.70 | −29.0% |
SPY's 6.53% / 0.45 reproduces #7's figures exactly, so the comparison is
like-for-like. The gate's 8.6% was inflated by ~2.1pp — the four errors' net. **The
full-cycle window does not rescue the return claim**; it lands at parity (−0.07pp)
and wins on risk, which is the same verdict the 20-year window gives at higher
absolute levels. Verified twice by different code paths: `compare_rotation_strategies(years=28)`
and the derived verdict in `scripts/rotation_credit_flow_sleeve.py`.
### ⚠️ Open threat to the corrected result — NFCI publication lag
The credit exposure is stamped at week `w`, but the Chicago Fed publishes NFCI with
a release lag, so a live book could not have acted on it that week. Sweeping the lag
on the **shipped** sleeve (correct alignment, bonds-or-bills), total-return panel:
| NFCI lag | CAGR | Sharpe | maxDD |
|---|---:|---:|---:|
| 0 weeks (as shipped) | 11.04% | 1.24 | −12.1% |
| 1 week | 10.30% | 1.16 | −12.7% |
| 2 weeks | 9.31% | 1.03 | −13.3% |
| 3 weeks | 8.42% | 0.92 | −15.2% |
| 4 weeks | 7.56% | 0.81 | **−22.3%** |
| *SPY buy & hold* | *11.08%* | *0.68* | *−54.6%* |
Two conclusions, and the second **disagrees with the 54-year study**:
1. **Return parity does not survive the lag.** It is a lag-0 artifact: one week of
delay already costs 0.74pp and puts the strategy 0.78pp behind SPY. Neither this
study nor the 54-year one should quote return parity as an edge.
2. **On this window the drawdown protection does not survive it either.** Past
~2 weeks maxDD degrades sharply — −12.1% → −22.3% by 4 weeks, an 84% increase.
### What the lag actually breaks: fast crises
The aggregate hides the mechanism. Per crisis, lag 1 → lag 4 (total return, correct
alignment, bonds/bills sleeve):
| crisis | wks to trough | benchmark speed | lag 1w | lag 4w | degradation | exposure at entry |
|---|---:|---:|---:|---:|---:|---:|
| GFC 2007–09 | 74 | 0.7%/wk | −7.3% | −7.9% | **+8%** | 3% |
| Rate bear 2022 | 38 | 0.6%/wk | −3.0% | −3.8% | **+27%** | 64% |
| **COVID 2020** | **6** | **5.3%/wk** | **−2.5%** | **−22.3%** | **+782%** | **89%** |
corr(speed, degradation) = **+1.00** (n=3 — the correlation itself is meaningless
at that size; the ordering and the order-of-magnitude gap are the finding). Fast
windows degrade +782%, slow ones +18%.
**The entire aggregate effect is one crisis.** The −22.3% four-week figure *is*
COVID; the other two barely move. And the exposure column shows why: entering the
GFC the gate was already 3% invested — credit stress built for months, so a
four-week delay changed nothing. Entering COVID it was **89% invested** and
de-risked *during* the crash, so delay is fatal. (The 54-year study measured the
same 89% for COVID independently.)
The 54-year study reached the opposite aggregate (−25.9% → −28.7%, ~11%) and then
**tested this hypothesis on its 13 windows and confirmed it**: corr(speed,
degradation) = **+0.90**, fast windows +101% vs slow +14%, and its own COVID row
goes −2.5% → −13.6% (+436%) — the worst row in its sample, concealed by an
aggregate whose maxDD is *set* by dot-com and 1973–74 and is therefore
lag-insensitive by construction. Two independent samples, same mechanism.
**Practical reading: a reader trading this today should assume the COVID row, not
the 1973 row.** The drawdown protection is robust to signal delay only when the
drawdown is slow, and the last two decades' crises have not been.
### The lag is measurable, and now measured
Both studies reached for a *sensitivity sweep* on a quantity that was observable
all along. NFCI's release schedule is knowable, and two independently-dated pulls
of the series settle it:
| fetched | last observation | gap | |
|---|---|---:|---|
| Tue 2026-06-23 | Fri 2026-06-12 | 11d | the day *before* that week's release |
| Thu 2026-09-03 | Fri 2026-08-28 | 6d | the day *after* |
Only **"released Wednesday, covering the week ending the prior Friday"** explains
both, and the 11-day case pins it — an 11-day-stale series on a Tuesday is only
possible if that week's release had not happened yet.
**What that means here.** `_simulate` sets week `w`'s allocation at the close of
Friday `w` and holds over `(w, w+1]`. At that moment the print dated Friday `w`
does not exist; the most recent available one is dated Friday `w-1`, released the
Wednesday two days earlier. So `NFCI_RELEASE_LAG_WEEKS = 1` and the exposure panel
is shifted one week. Costs **0.74pp** of CAGR against the untradeable same-week
reading — and that reading was a genuine look-ahead, not a convention choice.
`DGS10` needs no such shift: it is daily and published the same evening, so the
Friday-`w` rate regime really is known at Friday `w`'s close.
> **⚠️ Do not copy the 54-year study's constant.** It uses `NFCI_LAG_WEEKS = 2`,
> because its returns are stamped at the *end* of the interval they cover while
> this engine's exposure is stamped at the *start*. Its shift-2 and this engine's
> shift-1 are the **same real-world timing**. Mixing the conventions over- or
> under-lags by a full week.
**COVID survives at tradeable timing** (−2.5%), which is consistent with the
fast-crisis result above: it is three-to-four weeks of delay that breaks it, and
the real lag sits just inside that. That is luck, not design — a signal published
one week later would have failed the one crisis in this window it most needed to
catch.
The alignment delta itself is lag-invariant, so none of this touches the
stale-stamping finding. But the *shipped* number is a lag-0 number, and the real
NFCI release lag has not been established. **This is the largest open question on
the strategy** — bigger than anything else in this file, because it bears on
whether the drawdown case (the only surviving case) holds at a lag you can trade,
in exactly the fast crises it is most wanted for.
> **Method notes.** Two, both earned the hard way across this and the 54-year study.
>
> 1. **Agreement between studies is not evidence; the independent re-runs are.**
> Every correction in either file was caught by re-measuring, never by one study
> reasoning about the other's numbers — and each line of work corrected the other
> twice, in both directions. Treat a cross-study "confirmation" as a hypothesis
> to re-measure locally. That is how the fast-crisis result above was found, and
> how the shift-1/shift-2 convention trap above was caught before it was copied.
> 2. **Prefer a measurement to a sensitivity sweep when the quantity is
> observable.** Both studies swept the NFCI lag across 1–4 weeks for days before
> either checked what the actual release schedule was. It was in the data the
> whole time, in two file timestamps. Sweeps are for what you cannot know.
> 3. **An intermittent failure will frame whatever you most recently added.** The
> 54-year study hit a full-suite red on its merged tree, deselected its own new
> test file, watched the suite go green, and came within a commit of "fixing" an
> innocent file. The actual culprit
> (`test_smart_money.py::test_compare_fund_top_holdings_respects_n_cap`) is a
> pre-existing race whose fixture drains a background rebuild on a 5-second
> *timeout* rather than joining the thread — so adding tests anywhere shifts the
> ordering that trips it. A deselect experiment cannot distinguish "my file is
> the polluter" from "my file changed the ordering". Reproduce a suspected
> pollution against the *unmodified* tree before believing it.
> 4. **After correcting a result, grep for every place that STATES it — not every
> place that COMPUTES it.** The two are different sets and the second is the
> smaller one. Fixing this sleeve's arithmetic left a hard-coded VERDICT block in
> its own runner asserting the old numbers directly beneath the new ones; the
> README's front-door claim; and a comparison table in
> [`MOMENTUM_SURVIVORSHIP_AND_REGIME.md`](MOMENTUM_SURVIVORSHIP_AND_REGIME.md)
> that only quotes them. The 54-year study failed the same way twice over — an
> unfixed runner, and a TL;DR still leading with the retired claim 100 lines above
> its own correction section. **Being right further down the page is not being
> right**: a TL;DR is the surface that keeps saying the old thing after the code
> is correct.
> 5. **Transfer mechanisms between studies, never constants.** *Three* times in
> this work a number looked confirmed because two sources sharing an error
> agreed, and every one had the same shape — the mechanism transferred, the
> number did not:
>
> | # | what transferred | what didn't |
> |---|---|---|
> | 1 | "the panel basis matters" | price-only here, total return there |
> | 2 | "the signal is published late" | shift-1 here, shift-2 there — same instant |
> | 3 | "the gate is drawdown control" | #7's framing was pre-correction; the 54-year study briefly cited it as corroboration of its own corrected result, and withdrew it |
>
> In each case copying the constant would have shipped a wrong result *while
> looking like corroboration*. Instance 3 is the sharpest, because it was
> committed in a document that already cited note 1.
>
> A related check on what agreement is worth: this study and the 54-year one land
> at 10.30% / 1.16 and 10.42% / 1.17 — but at **−12.7% vs −26.8%** maxDD, which is
> as it should be, because one window is the SPY era and the other contains 1973
> and dot-com. Two studies agreeing on the quantity they *should* agree on and
> diverging on the one they *should* diverge on is stronger evidence than either
> match alone.
### ⚠️ `daily_closes` is mixed-basis
Worth flagging separately: `app/sources/sp500.py` fetches with `auto_adjust=True`
("required for breadth correctness") and writes into the **same** `daily_closes`
table that `app/sources/rotation.py` fills with unadjusted closes. Whichever writer
last touched a ticker decides its basis. In this study's DB the rotation tickers are
unadjusted (verified: IEF matches yfinance `Close` to 0.0000 over 6,011 days), but
the table has no basis column and no invariant enforcing one. Any analysis spanning
both universes is silently mixing price and total returns.
The app's own `/backtest/stovall` page runs the price-only engine, so the figures
quoted in the UI stay on that basis and are compared against a price-only SPY —
same-basis, internally consistent, and understated in absolute terms. Switching
the panel to adjusted closes is a repo-wide change (it feeds flow, breadth and
every other rotation feature) and is **not** done here.
### What is *not* affected
- **The live trading signal.** `compute_stovall_credit_bonds_signal` /
`compute_index_credit_bonds_signal` compute today's exposure and rate regime
from current data; neither reads the historical defensive-return panel. The
positions the app recommends are unchanged — only the historical performance
attributed to them was wrong.
- **`/backtest/stovall/rebalance-overlays`** (`compare_stovall_variants`). Its
daily engine holds real defensive-sector ETFs as a basket and prices them over
the held interval; it never constructs a synthetic defensive return and does not
import `_credit_scaled_panels` or `defensive_return_by_week`. Verified
unaffected — `stovall_macro` and friends are unchanged (Sharpe ~0.6, maxDD
−44 to −47%, which is what a defensive *equity* sleeve looks like).
- **Any strategy without a bond sleeve** — every `→ cash` variant and the plain
policies, as the table above shows.
### Reproduce
```bash
python -m scripts.credit_defensive_leg_alignment --years 20 --cost 5 --placebos
```
[`scripts/credit_defensive_leg_alignment.py`](../scripts/credit_defensive_leg_alignment.py)
runs both alignments on one panel and prints the table, the bias decomposition and
(with `--placebos`) the lag sweep + gate placebos that separate alignment from a
level effect. `--stale` runs the pre-fix arm alone. To reproduce the total-return
row, rebuild `daily_closes` for SPY / the 11 SPDRs / IEF with
`yf.download(..., auto_adjust=True)` against a scratch copy of the DB and re-run.
### Still carrying the bug (open follow-up)
The same unshifted `iefw` pattern appeared in five research scripts that each kept
their own copy of the overlay formula. None was on a production path; all backed
published research numbers. **All five are now corrected:**
| script | backs | status |
|---|---|---|
| ~~[`backend/scripts/long_history_credit_gate.py`](../backend/scripts/long_history_credit_gate.py)~~ | [`LONG_HISTORY_CREDIT_GATE.md`](LONG_HISTORY_CREDIT_GATE.md) | **fixed** (PR #572): 12.7% / 1.41 → **10.4% / 1.17 / −26.8%** |
| ~~[`backend/scripts/out_of_sample_credit_gate.py`](../backend/scripts/out_of_sample_credit_gate.py)~~ | [`OUT_OF_SAMPLE_CREDIT_GATE.md`](OUT_OF_SAMPLE_CREDIT_GATE.md) | **fixed** (PR #561): country 1.13→**0.89**, EU sector 1.22→**0.90**; drawdown barely moves |
| ~~[`scripts/rotation_credit_flow_sleeve.py`](../scripts/rotation_credit_flow_sleeve.py)~~ | credit + flow sleeve ([NEGATIVE_FINDINGS](NEGATIVE_FINDINGS.md) #7) | **fixed** (PR #565): OOS SPY+gate 1.34 → **1.13**, verdict intact |
| ~~[`scripts/rotation_dispersion_stovall.py`](../scripts/rotation_dispersion_stovall.py)~~ | dispersion-conditional (#8) | **fixed** (PR #565): verdict intact, conditioning still loses |
| ~~[`scripts/credit_gate_source_comparison.py`](../scripts/credit_gate_source_comparison.py)~~ | NFCICREDIT vs HY OAS | **fixed** (PR #565): conclusion *strengthened* — see below |
Each carried the stale defensive leg and the 0%
cash leg; none needed the alignment fix on its *equity* exposure, because all four
already lagged NFCI by a week — except `long_history_credit_gate.py`, which lagged
neither and needed both (its returns are stamped at the END of the interval, so it
takes `shift(2)` where this engine takes `shift(1)`; see method note 5). The
pattern across every one of them: gated numbers fall ~0.2–0.3 Sharpe and ~2–2.5pp
of CAGR, ungated controls come back bit-identical, and **no verdict changed** —
the errors moved levels, not rankings.
That prediction held exactly: `scripts/rotation_credit_flow_sleeve.py` fed its own
`defret` dict straight into `rs._simulate`, so it had the production bug verbatim.
Its ranking survived and its levels did not — OOS SPY+gate 1.34 → 1.13, every flow
variant still below the plain gate. The one framing casualty is
[NEGATIVE_FINDINGS](NEGATIVE_FINDINGS.md) #7's *"half the drawdown for ~the same
return"*: the OOS shortfall against SPY widens from −1.8pp to **−4.1pp/yr**, so the
"~same return" half no longer holds.
## ⚠️ Data caveat — use NFCICREDIT, not HY OAS
The intuitive credit-stress series is the ICE BofA **HY OAS** (`BAMLH0A0HYM2`),
but **FRED only serves ~3 years of it (2023-06+) — to anyone, key or not.** This
was verified directly against the keyed FRED JSON API: `BAMLH0A0HYM2` returns
`count=783` (2023-06→now), while `DGS10` and `NFCICREDIT` come back full-history
with the *same* key (`count` 7,413 / 1,483). So it is **not** a keyless-vs-keyed
issue — it's the **ICE BofA data-licensing restriction**: FRED no longer
distributes the deep history of its ICE OAS series without an ICE license. A
`FRED_API_KEY` does **not** unlock it (earlier notes that said it would are
wrong).
**`NFCICREDIT`** (Chicago Fed NFCI credit sub-index) comes back in full (weekly,
1971+), so it is the credit series to use — and conclusively the *only* viable
full-history credit-stress input here.
**Head-to-head on the window where both exist** (2023-09 → 2026-06, 147 wks — short
and bull-dominated, so read it as a tie-break, not a verdict). Corrected in PR #565,
which also fixed an asymmetry that had been flattering NFCICREDIT: both gates were
run *unlagged*, but NFCI is weekly with a Wednesday release while HY OAS is daily
and usable same-day, so only NFCI needed a shift.
| gate | CAGR | Sharpe | maxDD |
|---|---:|---:|---:|
| NFCICREDIT (lagged 1w — honest) | **13.1%** | **1.25** | −11.4% |
| HY OAS (same-day — honest) | 12.8% | 1.10 | −10.1% |
| Stovall, no gate | 20.1% | 1.33 | −14.2% |
Counter-intuitively, **removing NFCI's unearned look-ahead left it ahead**: pre-fix
HY OAS actually *beat* it on CAGR and drawdown (16.6% / 1.40 / −9.0% vs 15.7% /
1.47 / −10.8%), and the stale-bond-leg fix cost HY OAS more than it cost NFCI. So
the NFCICREDIT choice is now better supported than when it was made — though it was
always a *data-availability* decision, not a performance one, and both gates trail
ungated Stovall badly in this particular melt-up window.
**The generalisable bit:** when you remove a bias that two arms shared *unequally*,
you cannot predict from first principles which arm the correction favours — here the
arm that had been *given* the look-ahead came out ahead once it was taken away,
because a second shared error was costing the other arm more. Pre-fix, this table
read as a clean win for HY OAS on both return and drawdown. Fix every shared bias
before reading a head-to-head, and re-run rather than reason about which way it
should move. It's also wired into the composite credit
lens as `nfci_credit` (deep-history coverage). The HY-OAS-vs-NFCICREDIT
comparison can't be run over a full cycle via FRED at all; NFCICREDIT is the
right call, settled.
## Price-regime overlay — tested, doesn't stack
A natural follow-up: does adding the SPY-200dma price-regime gate on top of the
credit gate help? **No, and the corrected numbers make it emphatic** —
`stovall_credit_regime` (Sharpe 0.78, −17.2% DD) is much *worse* than
`stovall_credit_bonds` (0.98, −12.8%): the two de-risk signals
overlap, so combining over-gates and the price whipsaw deepens drawdown. The
price-regime gate is a real *standalone* de-risk (plain Stovall −60.8% → −23.5%
DD) and needs only SPY, but credit is the better trigger when available. Full
study: [`MOMENTUM_SURVIVORSHIP_AND_REGIME.md`](MOMENTUM_SURVIVORSHIP_AND_REGIME.md).
**Same story for an HMM regime gate.** A Gaussian Hidden Markov Model on SPY
(log-return + realized vol) is a legitimate *standalone* drawdown reducer (SPY
maxDD −56% → −41% OOS, Sharpe ~flat) but **does not stack** on the credit gate:
combined Sharpe 1.24 < credit-alone 1.27 (both pre-correction, and both inflated
by the same stale bond leg — the *ordering* is what matters), and the two de-risk
signals overlap
(corr +0.31; the HMM de-risks in only ~17% of weeks and in 88% of those the
credit gate is already firing). Credit (`NFCICREDIT`) sees stress earlier and
more selectively than a price/vol HMM. Keep the HMM as market *context* (the
`/hmm` page), not a winner overlay. Full study + honest (no-lookahead) method:
[`HMM_REGIME_RESEARCH.md`](HMM_REGIME_RESEARCH.md).
## Reproduce
```bash
# seed the inputs once (point DATABASE_URL at the target DB):
python -m scripts.backfill_sector_history --years 28 # SPY + 11 SPDR sectors
python -m scripts.backfill_credit_inputs --years 30 # NFCICREDIT + DGS10 + IEF
python - <<'PY'
from app.scoring.rotation_strategies import compare_rotation_strategies
res = compare_rotation_strategies(years=20)
for s in sorted(res.strategies, key=lambda s: -s.sharpe):
if "credit" in s.key or s.key in ("stovall","stovall_regime"):
print(f"{s.key:24s} Sharpe {s.sharpe:5.2f} maxDD {s.max_drawdown:6.1%} alpha {s.alpha_vs_benchmark:6.0%}")
PY
```
## Bottom line
What survives is **the sleeve, not the selection, and as risk control, not
return**: Stovall's sector picks are ordinary, and parking the de-risked half in
intermediate Treasuries turns a −61%-drawdown also-ran into a −12%-drawdown book
that earns roughly the market's return (**10.62% vs SPY 11.08%**, total return) at
a **fifth of the drawdown** and nearly double the Sharpe (1.20 vs 0.68). Net green
through 2008, 2020 and 2022. Worth holding — just not the buy-hold-beater this file
claimed before Sep 2026.
Three things to keep straight, because each was got wrong at some point:
1. **The +2.7pp that made it look like alpha was stale stamping**, not carry, not
dividends. Re-deriving it by giving the *gate* a look-ahead reproduces the old
number to within 0.06pp.
2. **The return that remains is bond carry, not the credit gate.** Always-bonds
earns more (11.00%); the gate trades ~0.4pp of return for ~3.2pp of drawdown.
3. **Judge it on total return, with a real cash rate.** The price-only panel is not
neutral here — it hides ~79% of IEF's return, and a strategy that sits in bonds
half the time is the one thing it distorts most; booking 0% cash penalised it
again on the other ~48% of weeks. Quoting 8.5% was *more* misleading about
earnable return than the buggy 11.1% was. The honest number, at timing you could
actually have traded, is **10.30%** — against SPY's 11.08%.
The broader lesson for this repo: **an overlay whose gate and whose payoff are drawn
from the same window will manufacture alpha out of nothing** — and **the accounting
basis is part of the result, not a footnote.** Two errors of opposite sign nearly
cancelled in the headline CAGR for years, which is exactly why neither was caught.
Four research scripts still carry the stamping pattern (table above), `daily_closes`
is mixed-basis, and the NFCI release lag is still unmeasured against the shipped
signal.
Surfaced in the app on the
[`/backtest/stovall`](../frontend/app/backtest/stovall/page.tsx) page (set
Lookback = 20) — where the table is price-only, so it prints ~2pp below the
total-return figures quoted here. The two credit-bonds cards quote total return.