← Experiments

Cumulative NH-NL Pine ta.cum / SMA50 / z-score fidelity re-audit

Rejected qm-kdnj.4 · 2026-08-18

Does the Pine-default Total Stock Market cumulative NH-NL z50 regime reproduce the authoritative dates, how far did the prior SMA50(raw)<0 experiment drift, and does the corrected risk-off state improve a causal SPY long/cash overlay on the maximal native span?

Pine semantics are frozen and fixture-exact. On 5,391 finite native dates (2005-03-15 through 2026-08-17), the corrected regime is risk-off on 1,812 days (33.61%) with 28 entries. Holding inputs fixed, prior SMA50(raw)<0 differs on 401 days (7.44%); the actual HIGN/LOWN legacy differs on 711 of 5,359 common days (13.27%). Corrected risk-off days precede deeper 21-day mean drawdowns (-3.79% vs -2.02%), but the causal SPY/cash overlay returns 7.11% CAGR and 4.334 final equity, below the same-input prior (7.76%, 4.937), actual legacy (8.68%, 5.915), and B&H (10.90%, 9.110). Fidelity is fixed; promotion is rejected without retuning.

Research narrative

Source-of-truth rule

TradingView Pine default: indexData=INDEX:MAHX-INDEX:MALX; cumulativeIndex=ta.cum(indexData); movingAverage=ta.sma(cumulativeIndex,50); zs=(cumulativeIndex-movingAverage)/ta.stdev(cumulativeIndex,50); sell=zs<0. The 50-bar standard deviation is population ddof=0, the current bar is included, and execution occurs on the next tradable close.

What changed

The prior experiment tested SMA50 of raw daily breadth below zero. The corrected rule tests whether the cumulative breadth line is below its own 50-day mean, normalized by its 50-day population standard deviation. The same-input audit attributes 401 mismatches to that formula change; comparing the actual legacy HIGN/LOWN implementation raises drift to 711 dates.

What the market evidence says

Corrected risk-off states identify substantially deeper subsequent drawdowns and protect the GFC and 2022 windows, but they do not improve full-window return, Sharpe, Sortino, or closest-comparator drawdown. Falsification and adjacent settings show the state is not noise, yet genuine defensive information is insufficient for promotion when incremental portfolio utility fails.

Decision

Reject promotion and retain the experiment. Fidelity outranks performance, so the result is published exactly as Pine defines it and no threshold, index family, or lookback is tuned to rescue the economics.

Generic-exit contract: Not applicable: this is a persistent two-state buy/sell regime, not a one-way buy-only or sell-only signal.

Corrected Pine regime equity vs SPY

risk-off 2005-04-25risk-on 2005-05-31risk-off 2005-10-28risk-on 2005-11-01risk-off 2006-06-19risk-on 2006-08-29risk-off 2007-08-06risk-on 2007-10-02risk-off 2007-11-08risk-on 2009-05-11risk-off 2010-06-29risk-on 2010-08-02risk-off 2010-08-19risk-on 2010-09-14risk-off 2011-08-04risk-on 2012-01-19risk-off 2012-05-18risk-on 2012-07-09risk-off 2012-11-16risk-on 2012-12-17risk-off 2014-09-26risk-on 2014-11-21risk-off 2014-12-16risk-on 2014-12-19risk-off 2015-07-21risk-on 2016-04-01risk-off 2016-11-04risk-on 2016-11-09risk-off 2018-04-02risk-on 2018-04-16risk-off 2018-10-11risk-on 2019-02-25risk-off 2019-05-28risk-on 2019-07-09risk-off 2019-08-05risk-on 2019-10-25risk-off 2020-02-28risk-on 2020-05-26risk-off 2021-11-30risk-on 2023-02-07risk-off 2023-03-10risk-on 2023-06-30risk-off 2023-08-18risk-on 2023-12-18risk-off 2024-04-25risk-on 2024-05-07risk-off 2024-06-14risk-on 2024-07-17risk-off 2024-12-30risk-on 2025-06-11risk-off 2025-11-17risk-on 2025-12-11risk-off 2025-12-31risk-on 2026-01-02risk-off 2026-03-19risk-on 2026-04-22

Aligned window, both rebased to 1.0 at start — Real monthly engine equity, next-close with 10 bps one-way costs · S&P dashed, experiment solid. X = Date, Y = Equity (rebased to 1.0).

Signal driver & thresholds (x-aligned)

Prior versus corrected dates

ComparisonCorrected activeMismatch %MismatchesPrior activeRows
Same input: SMA50(raw) vs cumulative-z5033.61%7.44%40134.48%5391
Actual legacy HIGN/LOWN vs corrected default33.74%13.27%71122.63%5359

Same-input comparison isolates formula drift; actual legacy also changes the breadth family.

Strategy-parity performance comparison

CAGRFinal equityMax drawdownRuleSharpeSortino
7.11%4.334-17.89%Corrected Pine cumulative-z500.7100.717
7.76%4.937-15.70%Prior SMA50(raw), same MAHX-MALX0.7540.765
8.68%5.915-21.82%Actual legacy HIGN-LOWN SMA50(raw)0.7450.806
10.90%9.110-55.19%SPY buy-and-hold0.6410.783

Same window, costs, and one-bar execution lag.

Frozen robustness checks

CheckResult
Extra execution lag+8.21% final equity vs corrected; not destroyed
Adjacent windows 40/45/50/55/6096.8%-98.5% state agreement; 6.69%-7.60% CAGR
Adjacent z thresholds -0.25/0/+0.2598.1%-98.4% agreement; 6.75%-7.71% CAGR
Circular 252-bar falsification4.95% CAGR / 0.388 Sharpe vs true 7.11% / 0.710
Inverted-state falsification3.27% CAGR / 0.282 Sharpe
Alternative Pine index choices79.0%-95.5% state agreement; default retained

No row is a retuning candidate; Pine length 50 and threshold zero remain authoritative.

Stats

CAGR7.11%Sharpe71.03%
Sortino71.73%maxDD-17.89%

Disposition

Rejected for risk-off-indicators/v1 and strategy promotion. The exact Pine regime is reproducible and has defensive timing information, but it provides no incremental return or downside advantage over the closest same-input prior. Publish the negative, corrected result as a qm-kdnj experiment; do not alter the risk-indicator registry or catalog.

Follow-on work

Errors & data gaps

TradingView daily closes are a pinned current snapshot, not a historical vintage archive. SPY ends 2026-07-24, so signal-date fidelity extends through 2026-08-17 while equity and outcome comparisons stop at 2026-07-24. The legacy comparator changes both index family and formula; the same-input formula comparator isolates SMA50(raw) versus cumulative-z drift. No synthetic pre-2005 extension or threshold retuning is included. The signal is a continuous two-state regime, not a one-way impulse, so the qm-kdnj generic-opposite exit harness is not applicable. Risk-off states predict materially deeper forward drawdowns but only modestly lower mean forward returns; the claim is defensive timing, not negative expected return. The page publishes derived z-scores, states, metrics, and metadata only; it does not redistribute raw TradingView observations.

Follow-up

gh issue create --title "Follow-up Cumulative NH-NL Pine tacum  SMA50  z-score fidelity re-audi" --body "Follow-up to qm-kdnj.4: Does the Pine-default Total Stock Market cumulative NH-NL z50 regime reproduce t" --label "priority:p2" --label "pipeline:research" --label "agent:ready"
# deep-link