{
  "experiment": {
    "alloc": {
      "labels": [
        "2007-01",
        "2026-08"
      ],
      "series": [
        {
          "name": "SPY",
          "values": [
            0.6,
            0.6
          ]
        },
        {
          "name": "CASH",
          "values": [
            0.4,
            0.4
          ]
        }
      ]
    },
    "alloc_as": null,
    "alloc_monthly_as": null,
    "alloc_monthly_ours": {
      "labels": [
        "2007-01",
        "2026-08"
      ],
      "series": [
        {
          "name": "SPY",
          "values": [
            0.6,
            0.6
          ]
        },
        {
          "name": "CASH",
          "values": [
            0.4,
            0.4
          ]
        }
      ]
    },
    "alloc_ours": {
      "labels": [
        "2007-01",
        "2026-08"
      ],
      "series": [
        {
          "name": "SPY",
          "values": [
            0.6,
            0.6
          ]
        },
        {
          "name": "CASH",
          "values": [
            0.4,
            0.4
          ]
        }
      ]
    },
    "alloc_yearly_as": null,
    "alloc_yearly_ours": {
      "labels": [
        "2007"
      ],
      "series": [
        {
          "name": "SPY",
          "values": [
            0.6
          ]
        },
        {
          "name": "CASH",
          "values": [
            0.4
          ]
        }
      ]
    },
    "analysis_page": null,
    "answer": "Pine semantics frozen and tick-for-tick correct (HMA20=WMA(2*WMA10-WMA20,4) sparse buy impulse, 19 triggers native vs 18 SPY-aligned due to 2008-11-27 Thanksgiving bar shift and Jan28 HMA drift from holiday gap — 10.5% calendar delta not definition bug; evaluator vs direct delta 0, mega crossunder independent from low crossover, no off-by-one/lookahead/ffill/EMA-seed, pinned fixture logic verified). Re-audit on maximal native 2006-12-29→2026-08-11 and SPY-aligned 2007-01-01→2026-08-04 shows prior qm-4bx.18/23 already Pine-correct for execution (18 triggers 224 active hw20 4.68%); native Pine truth is 19 triggers 239 active 4.82% including Thanksgiving-bar. Signal is sparse buy-only (0.92/yr native) not persistent regime. Walk-forward both halves +29%/+33%, falsification passes (random 0 trig =base, inverted 0 trig 4.66), extra lag -2.6% not destructive, generic-exit harness +73% vs SMA200 but 0% vs B&H and brittle (HMA-only, mega 1 drops to 5.79, holding 60d 12.58 dominates).",
    "bead_ids": [
      "qm-kdnj.1"
    ],
    "cost_variants": {},
    "coverage": {
      "alloc_monthly_labels_n": 12,
      "alloc_yearly_labels_n": 0,
      "as_alloc_rows": 0,
      "as_history_start_year": null,
      "as_returns_n": 0,
      "as_yearly_alloc_rows": 0,
      "coverage_generated_at": "2026-08-04T00:00:00Z",
      "db_path": "data/market.sqlite",
      "db_warm": true,
      "gap_years": null,
      "limiting": {
        "effective_start": "2001-06-05",
        "id": "INDEX:HIGN",
        "kind": "ohlcv",
        "native_start": "2001-06-05",
        "proxied": false,
        "proxy_chain": [],
        "span_basis": "db"
      },
      "macro_meta": [],
      "macros": [],
      "monthly_labels_n": 2,
      "ours_alloc_rows": 2,
      "ours_returns_n": 2,
      "ticker_meta": [
        {
          "end": "2026-08-11",
          "n_rows": 6331,
          "start": "2001-06-05",
          "ticker": "INDEX:HIGN"
        },
        {
          "end": "2026-08-11",
          "n_rows": 6312,
          "start": "2001-06-05",
          "ticker": "INDEX:LOWN"
        },
        {
          "end": "2026-08-17",
          "n_rows": 5440,
          "start": "2005-01-03",
          "ticker": "INDEX:MAHX"
        },
        {
          "end": "2026-08-17",
          "n_rows": 5440,
          "start": "2005-01-03",
          "ticker": "INDEX:MALX"
        },
        {
          "end": "2026-07-24",
          "n_rows": 8428,
          "start": "1993-01-29",
          "ticker": "SPY"
        }
      ],
      "tickers": [
        "INDEX:HIGN",
        "INDEX:LOWN",
        "INDEX:MAHX",
        "INDEX:MALX",
        "SPY"
      ]
    },
    "date": "2026-08-18",
    "disposition": "Rejected for risk-off-indicators/v1 and strategy promotion — fidelity verified (Pine-native 19 vs SPY 18, delta 2 calendar-driven, no HMA/crossover bug; prior already correct for execution) but brittle/optimization risk and sparse power; publish as qm-kdnj experiment with frozen Pine semantics, parity metrics, and generic-exit harness. Retain as risk-signals/v1 SHIP as signal (buy-signals-v1.json s5fi-breadth, signals/history.json, docs/signals.html).",
    "equity": {
      "experiment": [
        1.0,
        8.013
      ],
      "labels": [
        "2007-01-01",
        "2026-08-04"
      ],
      "spy": [
        1.0,
        7.47
      ],
      "spy_labels": [
        "2007-01-01",
        "2026-08-04"
      ]
    },
    "errors": "Native INDEX:S5FI 2006-12-29→2026-08-11 4956 rows TradingView daily; SPY-aligned 18 triggers loses Thanksgiving 2008-11-27 bar vs native 19 (HMA drift on holiday gap) — Pine native 19 is documentation truth, execution 18 is tradeable; pre-2006 insufficient_history without licensed 500-stock constituent history — no synthetic invented beyond ETF proxy 1999-03-05 (9 sector SPDRs, 0.93 corr but weaker 5.88 vs 8.01) Only HMA20 works (SMA/EMA/WMA/Wilder collapse to base ~4.5) — HMA dependence disclosed, not repaired; mega 0 brittle (±1 drops 2.2 to 5.79) and low10 9.55 narrowly beats 8.5 — threshold plateau not lone optimum Holding window monotonic 60d 12.58 dominates 20d 8.01 — optimization risk; 20 frozen per best-practice not 60; decay/retrigger boolean identical to fixed for sparse; consensus overlay 0 vs SMA200 (needs base bullish) fails SPY B&H zero marginal (already max long) — rescue-only for defensive bases (+73% vs SMA200, +10.9% vs 60/40); 0.92/yr sparse limited power despite 19y span; ensemble 5/8.5/10 voting could reduce brittleness but not blended DB 100M near 95MB soft limit but under 100M hard; sidecar data/sim_daily.sqlite not used for S5FI; closed market holidays (Thanksgiving) cause 10.5% native vs execution date divergence — documented not a signal bug Extra lag +1 bar -2.6% small drag, still > base; walk-forward both halves positive but with window optimization risk; need frozen holding/overlay pre-registered OOS 36 Deflated Sharpe before admission",
    "follow_on": [
      {
        "status": "deferred",
        "title": "No explicit follow-on; file new issue if needed"
      }
    ],
    "followup_command": "gh issue create --title \"Follow-up SP 500 breadth low Pine HMA20 850 fidelity re-audit\" --body \"Follow-up to qm-kdnj.1: Does the Pine-verbatim S&P 500 breadth low HMA20 8.5/0 crossover/crossunder (req\" --label \"priority:p2\" --label \"pipeline:research\" --label \"agent:ready\"",
    "gh_command": "gh issue create --title \"Follow-up SP 500 breadth low Pine HMA20 850 fidelity re-audit\" --body \"Follow-up to qm-kdnj.1: Does the Pine-verbatim S&P 500 breadth low HMA20 8.5/0 crossover/crossunder (req\" --label \"priority:p2\" --label \"pipeline:research\" --label \"agent:ready\"",
    "id": "qm-kdnj.1",
    "issue_ids": [
      "qm-kdnj.1"
    ],
    "monthly": {
      "as": [
        null,
        null
      ],
      "labels": [
        "2007-01",
        "2026-08"
      ],
      "ours": [
        0.0,
        7.013
      ]
    },
    "page": "experiments/qm-kdnj.1.html",
    "performance": {
      "cagr": 0.0,
      "max_drawdown": 0.0,
      "max_drawdown_fallback_rule": "Use daily backtest equity when available; otherwise compound published monthly returns and label the result monthly.",
      "max_drawdown_observation_frequency": "monthly",
      "sharpe": 0.0,
      "sortino": 0.0,
      "volatility": null
    },
    "provenance": {
      "artifact": "research/findings/s5fi-breadth-buy-signal-qm-4bx.23.json",
      "code": "backtest/spx_breadth_low.py",
      "finding": "research/findings/spx-breadth-low-qm-4bx.18.md",
      "site_data": "site-data/experiments/qm-kdnj.1.json",
      "tearsheet": null
    },
    "question": "Does the Pine-verbatim S&P 500 breadth low HMA20 8.5/0 crossover/crossunder (request.security D close, ta.hma WMA steps, ta.crossover prev<=8.5 & curr>8.5, ta.crossunder prev>=0 & curr<0) reproduce signal dates tick-for-tick and does the corrected signal predict capitulation recovery beyond generic defensive on maximal native span?",
    "safe_withdrawal": null,
    "signalSeries": {
      "active": [
        false,
        false
      ],
      "driver": "Signal driver",
      "entryValue": 0.0,
      "exitValue": 0.0,
      "inputs": [],
      "isDynamic": false,
      "isMulti": false,
      "labels": [
        "2007-01-01",
        "2026-08-04"
      ],
      "megaThreshold": null,
      "megaThresholdLabel": null,
      "threshold": 0.0,
      "thresholdKind": "fixed",
      "thresholdLabel": "Entry 0.0",
      "trigger": [
        false,
        false
      ],
      "triggers": [],
      "unit": "",
      "values": [
        -0.18,
        -0.229
      ],
      "yLabel": "Indicator value"
    },
    "signals": [],
    "slug": "qm-kdnj.1",
    "stats": {
      "adjacent": {
        "hma9_6_46": true,
        "hma_only": true,
        "holding_5_5_41": true,
        "holding_60_12_58_monotonic": true,
        "low10_mega0_9_55": true,
        "low5_mega0_6_88": true,
        "low8_5_mega0_8_01": true,
        "mega0_to_1_drop_2_2": true,
        "q0_10_9_82_beats_absolute": true,
        "sma20_4_54_collapse": true
      },
      "baseline": {
        "first_trigger_native": "2008-01-28",
        "first_trigger_spy": "2008-10-10",
        "hma_span": "2007-01-31 → 2026-08-11",
        "last_trigger": "2023-10-09",
        "n_active_hw20_native": 239,
        "n_active_hw20_spy": 224,
        "n_rows_native": 4956,
        "n_triggers_native": 19,
        "n_triggers_spy_aligned": 18,
        "native_span": "2006-12-29 → 2026-08-11",
        "pct_active_native": 0.04822,
        "pct_active_spy": 0.04678,
        "triggers_per_year_native": 0.97,
        "triggers_per_year_spy": 0.92
      },
      "cagr": 0.0,
      "data_alternatives": {
        "breadth200_corr": 0.581,
        "native_equity": 8.013,
        "synthetic_breadth50_triggers": 18,
        "synthetic_equity": 5.88,
        "synthetic_status": "calibration only, native retained",
        "synthetic_weaker_but_positive": true
      },
      "falsification": {
        "both_pass": true,
        "inverted_0_trig_4_66": true,
        "randomized_0_trig_4_637_eq_base": true
      },
      "forward_or_lag": {
        "base_equity": 8.013,
        "extra_lag_shift1_equity": 7.807,
        "lag_delta_pct": -2.57,
        "lag_not_destructive": true
      },
      "generic_exit_harness": {
        "bh_cagr_base": 0.1084886239974534,
        "bh_cagr_blend": 0.1084886239974534,
        "bh_delta_cagr": 0.0,
        "bh_delta_maxDD": 0.0,
        "bh_delta_pct": 0.0,
        "bh_delta_sharpe": 0.0,
        "bh_generic_only": 7.47006221252744,
        "bh_is_bh_only": true,
        "bh_maxDD_base": -0.5518943153747867,
        "bh_maxDD_blend": -0.5518943153747867,
        "bh_sharpe_base": 0.6234671339235841,
        "bh_sharpe_blend": 0.6234671339235841,
        "bh_signal_plus_generic": 7.47006221252744,
        "cross_50_200_generic_only": 5.307496340068713,
        "cross_cagr_base": 0.08925232849766918,
        "cross_cagr_blend": 0.1101545105413928,
        "cross_delta_cagr": 0.0209,
        "cross_delta_maxDD": -0.0,
        "cross_delta_pct": 44.93,
        "cross_delta_sharpe": 0.0491,
        "cross_false_signal": 45,
        "cross_hit": 179,
        "cross_maxDD_base": -0.3371726274233201,
        "cross_maxDD_blend": -0.33717262742332055,
        "cross_sharpe_base": 0.6795630937409454,
        "cross_sharpe_blend": 0.7286539451988968,
        "cross_signal_plus_generic": 7.692321015890443,
        "native_span": "INDEX:S5FI 4956 rows 2006-12-29→2026-08-11 tradingview daily; window 2007-01-03→2026-07-24 4920 bars",
        "note": "S&P 500 breadth low HMA20 8.5/0 buy impulse (Pine ta.hma WMA steps ta.crossover/crossunder, hw20 fixed) paired with generic opposite SPX <50DMA, <200DMA, 50/200 death-cross, trailing-stop 10/15/20% via backtest/generic_signals.py — each head-to-head generic-only vs signal+generic on same window/costs/lag via BacktestConfig.allocatesmartly() next_close 10bps, offline ensure_ohlcv offline=True, INDEX:S5FI 4956 rows 2006-12-29..2026-08-11 tradingview",
        "overlay_60_40_base": 4.82,
        "overlay_60_40_blend": 5.345,
        "overlay_60_40_delta_pct": 10.9,
        "sma200_cagr_base": 0.08731515526712696,
        "sma200_cagr_blend": 0.11820489533054812,
        "sma200_delta_cagr": 0.03089,
        "sma200_delta_maxDD": -0.02091,
        "sma200_delta_pct": 72.79,
        "sma200_delta_sharpe": 0.0654,
        "sma200_false_signal": 20,
        "sma200_generic_only": 5.126213766744461,
        "sma200_hit": 204,
        "sma200_maxDD_base": -0.20932772520224507,
        "sma200_maxDD_blend": -0.2302357445140769,
        "sma200_sharpe_base": 0.7675516115545757,
        "sma200_sharpe_blend": 0.832972991239231,
        "sma200_sharpe_blend_gt_base": true,
        "sma200_signal_plus_generic": 8.857728420484023,
        "sma50_cagr_base": 0.04185812480693385,
        "sma50_cagr_blend": 0.07256723100747298,
        "sma50_delta_cagr": 0.03071,
        "sma50_delta_maxDD": 0.08221,
        "sma50_delta_pct": 76.32,
        "sma50_delta_sharpe": 0.1428,
        "sma50_false_signal": 26,
        "sma50_generic_only": 2.2268521320028203,
        "sma50_hit": 198,
        "sma50_maxDD_base": -0.3800611967151426,
        "sma50_maxDD_blend": -0.29784662124685557,
        "sma50_sharpe_base": 0.4258934190474592,
        "sma50_sharpe_blend": 0.5687293843141507,
        "sma50_signal_plus_generic": 3.926473016504207,
        "trail_delta_pct": 80.4,
        "trailing_10pct_false_signal": 38,
        "trailing_10pct_hit": 186,
        "trailing_15pct_cagr_base": 0.06329649550413907,
        "trailing_15pct_cagr_blend": 0.09378247518433747,
        "trailing_15pct_delta_cagr": 0.03049,
        "trailing_15pct_delta_maxDD": 0.04044,
        "trailing_15pct_delta_pct": 73.65,
        "trailing_15pct_delta_sharpe": 0.117,
        "trailing_15pct_false_signal": 64,
        "trailing_15pct_hit": 160,
        "trailing_15pct_maxDD_base": -0.3209837666556653,
        "trailing_15pct_maxDD_blend": -0.28054748758720205,
        "trailing_15pct_sharpe_base": 0.5285512829071789,
        "trailing_15pct_sharpe_blend": 0.6455528754980223,
        "trailing_15pct_signal_plus_generic": 5.755468243439691,
        "trailing_20pct_cagr_base": 0.07920152619227738,
        "trailing_20pct_cagr_blend": 0.1051510295899174,
        "trailing_20pct_delta_cagr": 0.02595,
        "trailing_20pct_delta_maxDD": 0.06719,
        "trailing_20pct_delta_pct": 59.03,
        "trailing_20pct_delta_sharpe": 0.0877,
        "trailing_20pct_false_signal": 114,
        "trailing_20pct_hit": 110,
        "trailing_20pct_maxDD_base": -0.38220544539981616,
        "trailing_20pct_maxDD_blend": -0.31501409554538107,
        "trailing_20pct_sharpe_base": 0.5819570650464623,
        "trailing_20pct_sharpe_blend": 0.6696585569383576,
        "trailing_20pct_signal_plus_generic": 7.042967503568875,
        "trailing_atr_cagr_base": 0.00775742143040814,
        "trailing_atr_cagr_blend": 0.03281875277988,
        "trailing_atr_delta_cagr": 0.02506,
        "trailing_atr_delta_maxDD": -0.02352,
        "trailing_atr_delta_pct": 61.54,
        "trailing_atr_delta_sharpe": 0.1978,
        "trailing_atr_false_signal": 0,
        "trailing_atr_generic_only": 1.1628454678948799,
        "trailing_atr_hit": 224,
        "trailing_atr_maxDD_base": -0.293906965926513,
        "trailing_atr_maxDD_blend": -0.3174222346883533,
        "trailing_atr_sharpe_base": 0.15210554555096298,
        "trailing_atr_sharpe_blend": 0.3498739751969923,
        "trailing_atr_signal_plus_generic": 1.8784694891841442,
        "trailing_cagr_base": 0.073574732467788,
        "trailing_cagr_blend": 0.10651164487669784,
        "trailing_delta_cagr": 0.03294,
        "trailing_delta_maxDD": -0.00644,
        "trailing_delta_pct": 80.4,
        "trailing_delta_sharpe": 0.1004,
        "trailing_maxDD_base": -0.22837114966832717,
        "trailing_maxDD_blend": -0.2348135270567432,
        "trailing_sharpe_base": 0.6705471321093699,
        "trailing_sharpe_blend": 0.7709327804217264,
        "trailing_signal_plus_generic": 7.214202894906068,
        "trailing_stop_10pct_generic_only": 3.9991122096519947,
        "trailing_stop_15pct_generic_only": 3.3143249551672866,
        "trailing_stop_20pct_generic_only": 4.42881865025316,
        "trailing_vol_cagr_base": -0.0011716219034170194,
        "trailing_vol_cagr_blend": 0.023667658276929737,
        "trailing_vol_delta_cagr": 0.02484,
        "trailing_vol_delta_maxDD": -0.01068,
        "trailing_vol_delta_pct": 61.54,
        "trailing_vol_delta_sharpe": 0.2586,
        "trailing_vol_false_signal": 0,
        "trailing_vol_generic_only": 0.9773720082982104,
        "trailing_vol_hit": 224,
        "trailing_vol_maxDD_base": -0.349779426413082,
        "trailing_vol_maxDD_blend": -0.3604635730686738,
        "trailing_vol_sharpe_base": 0.012071080229078048,
        "trailing_vol_sharpe_blend": 0.27068906236389656,
        "trailing_vol_signal_plus_generic": 1.5788542397593794,
        "trigger_active_stats": {
          "active_hw20_in_window": 224,
          "n_rows_native": 4956,
          "native_span": "2006-12-29→2026-08-11",
          "pct_active": 0.04553,
          "triggers_in_window": 18
        },
        "valid_bars": 4920,
        "window": "2007-01-03→2026-07-24 same window/costs/lag next_close +10bps"
      },
      "holding_window_monotonic": {
        "frozen": "hw20 per best-practice not 60",
        "hw20": 8.013,
        "hw60": 12.58
      },
      "maxDD": 0.0,
      "prior_vs_corrected": {
        "crossunder_independent": true,
        "evaluator_vs_direct_delta": 0,
        "hma_tick_for_tick": true,
        "mismatch_pct": 0.105,
        "mismatched_native_vs_spy": 2,
        "native_extra": "2008-01-28",
        "new_native_triggers": 19,
        "new_spy_triggers": 18,
        "note": "No HMA/crossover bug; holiday calendar gap (S5FI has Thanksgiving bar, SPY calendar does not) causes HMA path drift and +1 native trigger; SPY-aligned 18 is execution-correct",
        "overlap_spy": 18,
        "pine_fixture_logic": true,
        "prior_spy_triggers": 18,
        "shifted": "2008-11-27→28"
      },
      "sharpe": 0.0,
      "sortino": 0.0,
      "subperiods": {
        "2007_gfc": 0.14,
        "2011": 0.08,
        "2022_bear": 0.095,
        "covid": 0.013,
        "post_2016_triggers": 9,
        "pre_2016_triggers": 9,
        "walk_forward_both_positive": true,
        "walk_forward_first_half_2007_16": 0.29,
        "walk_forward_second_half_2016_26": 0.33
      }
    },
    "status": "rejected",
    "status_chip": "Rejected",
    "supplemental": {
      "audit": "19 native triggers [2008-01-28, 2008-10-10, 2008-11-27, 2009-03-12, 2010-06-04, 2010-07-09, 2011-08-10, 2011-08-26, 2015-09-09, 2016-01-26, 2018-12-28, 2019-01-09, 2020-03-16, 2020-04-08, 2022-06-22, 2022-06-29, 2022-09-29, 2022-10-07, 2023-10-09] vs SPY-aligned 18 (drops Jan28, shifts Nov27→28) — 2 mismatches holiday-driven; evaluator _signal_s5fi_hma vs direct spx_breadth_buy_signal delta 0; no ffill/lookahead/EMA-seed; HMA prefix 19 bars NA",
      "generic_exit_harness": {
        "bh_cagr_base": 0.1084886239974534,
        "bh_cagr_blend": 0.1084886239974534,
        "bh_delta_cagr": 0.0,
        "bh_delta_maxDD": 0.0,
        "bh_delta_pct": 0.0,
        "bh_delta_sharpe": 0.0,
        "bh_generic_only": 7.47006221252744,
        "bh_is_bh_only": true,
        "bh_maxDD_base": -0.5518943153747867,
        "bh_maxDD_blend": -0.5518943153747867,
        "bh_sharpe_base": 0.6234671339235841,
        "bh_sharpe_blend": 0.6234671339235841,
        "bh_signal_plus_generic": 7.47006221252744,
        "cross_50_200_generic_only": 5.307496340068713,
        "cross_cagr_base": 0.08925232849766918,
        "cross_cagr_blend": 0.1101545105413928,
        "cross_delta_cagr": 0.0209,
        "cross_delta_maxDD": -0.0,
        "cross_delta_pct": 44.93,
        "cross_delta_sharpe": 0.0491,
        "cross_false_signal": 45,
        "cross_hit": 179,
        "cross_maxDD_base": -0.3371726274233201,
        "cross_maxDD_blend": -0.33717262742332055,
        "cross_sharpe_base": 0.6795630937409454,
        "cross_sharpe_blend": 0.7286539451988968,
        "cross_signal_plus_generic": 7.692321015890443,
        "native_span": "INDEX:S5FI 4956 rows 2006-12-29→2026-08-11 tradingview daily; window 2007-01-03→2026-07-24 4920 bars",
        "note": "S&P 500 breadth low HMA20 8.5/0 buy impulse (Pine ta.hma WMA steps ta.crossover/crossunder, hw20 fixed) paired with generic opposite SPX <50DMA, <200DMA, 50/200 death-cross, trailing-stop 10/15/20% via backtest/generic_signals.py — each head-to-head generic-only vs signal+generic on same window/costs/lag via BacktestConfig.allocatesmartly() next_close 10bps, offline ensure_ohlcv offline=True, INDEX:S5FI 4956 rows 2006-12-29..2026-08-11 tradingview",
        "overlay_60_40_base": 4.82,
        "overlay_60_40_blend": 5.345,
        "overlay_60_40_delta_pct": 10.9,
        "sma200_cagr_base": 0.08731515526712696,
        "sma200_cagr_blend": 0.11820489533054812,
        "sma200_delta_cagr": 0.03089,
        "sma200_delta_maxDD": -0.02091,
        "sma200_delta_pct": 72.79,
        "sma200_delta_sharpe": 0.0654,
        "sma200_false_signal": 20,
        "sma200_generic_only": 5.126213766744461,
        "sma200_hit": 204,
        "sma200_maxDD_base": -0.20932772520224507,
        "sma200_maxDD_blend": -0.2302357445140769,
        "sma200_sharpe_base": 0.7675516115545757,
        "sma200_sharpe_blend": 0.832972991239231,
        "sma200_sharpe_blend_gt_base": true,
        "sma200_signal_plus_generic": 8.857728420484023,
        "sma50_cagr_base": 0.04185812480693385,
        "sma50_cagr_blend": 0.07256723100747298,
        "sma50_delta_cagr": 0.03071,
        "sma50_delta_maxDD": 0.08221,
        "sma50_delta_pct": 76.32,
        "sma50_delta_sharpe": 0.1428,
        "sma50_false_signal": 26,
        "sma50_generic_only": 2.2268521320028203,
        "sma50_hit": 198,
        "sma50_maxDD_base": -0.3800611967151426,
        "sma50_maxDD_blend": -0.29784662124685557,
        "sma50_sharpe_base": 0.4258934190474592,
        "sma50_sharpe_blend": 0.5687293843141507,
        "sma50_signal_plus_generic": 3.926473016504207,
        "trail_delta_pct": 80.4,
        "trailing_10pct_false_signal": 38,
        "trailing_10pct_hit": 186,
        "trailing_15pct_cagr_base": 0.06329649550413907,
        "trailing_15pct_cagr_blend": 0.09378247518433747,
        "trailing_15pct_delta_cagr": 0.03049,
        "trailing_15pct_delta_maxDD": 0.04044,
        "trailing_15pct_delta_pct": 73.65,
        "trailing_15pct_delta_sharpe": 0.117,
        "trailing_15pct_false_signal": 64,
        "trailing_15pct_hit": 160,
        "trailing_15pct_maxDD_base": -0.3209837666556653,
        "trailing_15pct_maxDD_blend": -0.28054748758720205,
        "trailing_15pct_sharpe_base": 0.5285512829071789,
        "trailing_15pct_sharpe_blend": 0.6455528754980223,
        "trailing_15pct_signal_plus_generic": 5.755468243439691,
        "trailing_20pct_cagr_base": 0.07920152619227738,
        "trailing_20pct_cagr_blend": 0.1051510295899174,
        "trailing_20pct_delta_cagr": 0.02595,
        "trailing_20pct_delta_maxDD": 0.06719,
        "trailing_20pct_delta_pct": 59.03,
        "trailing_20pct_delta_sharpe": 0.0877,
        "trailing_20pct_false_signal": 114,
        "trailing_20pct_hit": 110,
        "trailing_20pct_maxDD_base": -0.38220544539981616,
        "trailing_20pct_maxDD_blend": -0.31501409554538107,
        "trailing_20pct_sharpe_base": 0.5819570650464623,
        "trailing_20pct_sharpe_blend": 0.6696585569383576,
        "trailing_20pct_signal_plus_generic": 7.042967503568875,
        "trailing_atr_cagr_base": 0.00775742143040814,
        "trailing_atr_cagr_blend": 0.03281875277988,
        "trailing_atr_delta_cagr": 0.02506,
        "trailing_atr_delta_maxDD": -0.02352,
        "trailing_atr_delta_pct": 61.54,
        "trailing_atr_delta_sharpe": 0.1978,
        "trailing_atr_false_signal": 0,
        "trailing_atr_generic_only": 1.1628454678948799,
        "trailing_atr_hit": 224,
        "trailing_atr_maxDD_base": -0.293906965926513,
        "trailing_atr_maxDD_blend": -0.3174222346883533,
        "trailing_atr_sharpe_base": 0.15210554555096298,
        "trailing_atr_sharpe_blend": 0.3498739751969923,
        "trailing_atr_signal_plus_generic": 1.8784694891841442,
        "trailing_cagr_base": 0.073574732467788,
        "trailing_cagr_blend": 0.10651164487669784,
        "trailing_delta_cagr": 0.03294,
        "trailing_delta_maxDD": -0.00644,
        "trailing_delta_pct": 80.4,
        "trailing_delta_sharpe": 0.1004,
        "trailing_maxDD_base": -0.22837114966832717,
        "trailing_maxDD_blend": -0.2348135270567432,
        "trailing_sharpe_base": 0.6705471321093699,
        "trailing_sharpe_blend": 0.7709327804217264,
        "trailing_signal_plus_generic": 7.214202894906068,
        "trailing_stop_10pct_generic_only": 3.9991122096519947,
        "trailing_stop_15pct_generic_only": 3.3143249551672866,
        "trailing_stop_20pct_generic_only": 4.42881865025316,
        "trailing_vol_cagr_base": -0.0011716219034170194,
        "trailing_vol_cagr_blend": 0.023667658276929737,
        "trailing_vol_delta_cagr": 0.02484,
        "trailing_vol_delta_maxDD": -0.01068,
        "trailing_vol_delta_pct": 61.54,
        "trailing_vol_delta_sharpe": 0.2586,
        "trailing_vol_false_signal": 0,
        "trailing_vol_generic_only": 0.9773720082982104,
        "trailing_vol_hit": 224,
        "trailing_vol_maxDD_base": -0.349779426413082,
        "trailing_vol_maxDD_blend": -0.3604635730686738,
        "trailing_vol_sharpe_base": 0.012071080229078048,
        "trailing_vol_sharpe_blend": 0.27068906236389656,
        "trailing_vol_signal_plus_generic": 1.5788542397593794,
        "trigger_active_stats": {
          "active_hw20_in_window": 224,
          "n_rows_native": 4956,
          "native_span": "2006-12-29→2026-08-11",
          "pct_active": 0.04553,
          "triggers_in_window": 18
        },
        "valid_bars": 4920,
        "window": "2007-01-03→2026-07-24 same window/costs/lag next_close +10bps"
      },
      "generic_exit_harness_detail": "S&P 500 breadth low HMA20 8.5/0 Pine buy impulse (ta.hma WMA(2*WMA10-WMA20,4), ta.crossover prev<=8.5 & curr>8.5, ta.crossunder prev>=0 & curr<0, OR independent, hw20 fixed, 18 triggers SPY-aligned 224 active 4.55%) blended with generic defensive via OR override (long if either generic long or signal active) — each head-to-head generic-only vs signal+generic on same window/costs/lag via BacktestConfig.allocatesmartly() next_close 10bps; deltas SMA50 76.3% (CAGR +3.07% Sharpe +0.14 MaxDD +8.22% hit 198/false 26), SMA200 72.8% (CAGR +3.09% Sharpe +0.07 MaxDD -2.09% hit 204/false 20), cross 44.9% (CAGR +2.09% Sharpe +0.05 MaxDD -0.00% hit 179/false 45), trailing10 80.4% (CAGR +3.29% Sharpe +0.10 MaxDD -0.64% hit 186/false 38), trailing15 73.7% (CAGR +3.05% Sharpe +0.12 MaxDD +4.04% hit 160/false 64), trailing20 59.0% (CAGR +2.60% Sharpe +0.09 MaxDD +6.72% hit 110/false 114), trailingATR3x 61.5% (CAGR +2.51% Sharpe +0.20 MaxDD -2.35% hit 224/false 0), trailingVol2x 61.5% (CAGR +2.48% Sharpe +0.26 MaxDD -1.07% hit 224/false 0), BH 0.0% (CAGR +0.00% Sharpe +0.00 MaxDD +0.00% hit 0/false 224) — window 2007-01-03→2026-07-24 same window/costs/lag next_close +10bps L20 S5FI 4956/224 active 4.55% tradingview close_only offline",
      "generic_exit_harness_hit_false": {
        "bh": {
          "false_signal": 224,
          "hit": 0
        },
        "cross_50_200": {
          "false_signal": 45,
          "hit": 179
        },
        "sma200": {
          "false_signal": 20,
          "hit": 204
        },
        "sma50": {
          "false_signal": 26,
          "hit": 198
        },
        "trailing_10pct": {
          "false_signal": 38,
          "hit": 186
        },
        "trailing_15pct": {
          "false_signal": 64,
          "hit": 160
        },
        "trailing_20pct": {
          "false_signal": 114,
          "hit": 110
        },
        "trailing_atr": {
          "false_signal": 0,
          "hit": 224
        },
        "trailing_vol": {
          "false_signal": 0,
          "hit": 224
        }
      },
      "generic_exit_harness_rows": [
        {
          "base_cagr": 0.04185812480693385,
          "base_equity": 2.2268521320028203,
          "base_maxDD": -0.3800611967151426,
          "base_sharpe": 0.4258934190474592,
          "blend_cagr": 0.07256723100747298,
          "blend_equity": 3.926473016504207,
          "blend_maxDD": -0.29784662124685557,
          "blend_sharpe": 0.5687293843141507,
          "delta_cagr": 0.03071,
          "delta_maxDD": 0.08221,
          "delta_pct": 76.32,
          "delta_sharpe": 0.1428,
          "false_signal": 26,
          "generic": "sma50",
          "hit": 198
        },
        {
          "base_cagr": 0.08731515526712696,
          "base_equity": 5.126213766744461,
          "base_maxDD": -0.20932772520224507,
          "base_sharpe": 0.7675516115545757,
          "blend_cagr": 0.11820489533054812,
          "blend_equity": 8.857728420484023,
          "blend_maxDD": -0.2302357445140769,
          "blend_sharpe": 0.832972991239231,
          "delta_cagr": 0.03089,
          "delta_maxDD": -0.02091,
          "delta_pct": 72.79,
          "delta_sharpe": 0.0654,
          "false_signal": 20,
          "generic": "sma200",
          "hit": 204
        },
        {
          "base_cagr": 0.08925232849766918,
          "base_equity": 5.307496340068713,
          "base_maxDD": -0.3371726274233201,
          "base_sharpe": 0.6795630937409454,
          "blend_cagr": 0.1101545105413928,
          "blend_equity": 7.692321015890443,
          "blend_maxDD": -0.33717262742332055,
          "blend_sharpe": 0.7286539451988968,
          "delta_cagr": 0.0209,
          "delta_maxDD": -0.0,
          "delta_pct": 44.93,
          "delta_sharpe": 0.0491,
          "false_signal": 45,
          "generic": "cross_50_200",
          "hit": 179
        },
        {
          "base_cagr": 0.073574732467788,
          "base_equity": 3.9991122096519947,
          "base_maxDD": -0.22837114966832717,
          "base_sharpe": 0.6705471321093699,
          "blend_cagr": 0.10651164487669784,
          "blend_equity": 7.214202894906068,
          "blend_maxDD": -0.2348135270567432,
          "blend_sharpe": 0.7709327804217264,
          "delta_cagr": 0.03294,
          "delta_maxDD": -0.00644,
          "delta_pct": 80.4,
          "delta_sharpe": 0.1004,
          "false_signal": 38,
          "generic": "trailing_10pct",
          "hit": 186
        },
        {
          "base_cagr": 0.06329649550413907,
          "base_equity": 3.3143249551672866,
          "base_maxDD": -0.3209837666556653,
          "base_sharpe": 0.5285512829071789,
          "blend_cagr": 0.09378247518433747,
          "blend_equity": 5.755468243439691,
          "blend_maxDD": -0.28054748758720205,
          "blend_sharpe": 0.6455528754980223,
          "delta_cagr": 0.03049,
          "delta_maxDD": 0.04044,
          "delta_pct": 73.65,
          "delta_sharpe": 0.117,
          "false_signal": 64,
          "generic": "trailing_15pct",
          "hit": 160
        },
        {
          "base_cagr": 0.07920152619227738,
          "base_equity": 4.42881865025316,
          "base_maxDD": -0.38220544539981616,
          "base_sharpe": 0.5819570650464623,
          "blend_cagr": 0.1051510295899174,
          "blend_equity": 7.042967503568875,
          "blend_maxDD": -0.31501409554538107,
          "blend_sharpe": 0.6696585569383576,
          "delta_cagr": 0.02595,
          "delta_maxDD": 0.06719,
          "delta_pct": 59.03,
          "delta_sharpe": 0.0877,
          "false_signal": 114,
          "generic": "trailing_20pct",
          "hit": 110
        },
        {
          "base_cagr": 0.00775742143040814,
          "base_equity": 1.1628454678948799,
          "base_maxDD": -0.293906965926513,
          "base_sharpe": 0.15210554555096298,
          "blend_cagr": 0.03281875277988,
          "blend_equity": 1.8784694891841442,
          "blend_maxDD": -0.3174222346883533,
          "blend_sharpe": 0.3498739751969923,
          "delta_cagr": 0.02506,
          "delta_maxDD": -0.02352,
          "delta_pct": 61.54,
          "delta_sharpe": 0.1978,
          "false_signal": 0,
          "generic": "trailing_atr",
          "hit": 224
        },
        {
          "base_cagr": -0.0011716219034170194,
          "base_equity": 0.9773720082982104,
          "base_maxDD": -0.349779426413082,
          "base_sharpe": 0.012071080229078048,
          "blend_cagr": 0.023667658276929737,
          "blend_equity": 1.5788542397593794,
          "blend_maxDD": -0.3604635730686738,
          "blend_sharpe": 0.27068906236389656,
          "delta_cagr": 0.02484,
          "delta_maxDD": -0.01068,
          "delta_pct": 61.54,
          "delta_sharpe": 0.2586,
          "false_signal": 0,
          "generic": "trailing_vol",
          "hit": 224
        },
        {
          "base_cagr": 0.1084886239974534,
          "base_equity": 7.47006221252744,
          "base_maxDD": -0.5518943153747867,
          "base_sharpe": 0.6234671339235841,
          "blend_cagr": 0.1084886239974534,
          "blend_equity": 7.47006221252744,
          "blend_maxDD": -0.5518943153747867,
          "blend_sharpe": 0.6234671339235841,
          "delta_cagr": 0.0,
          "delta_maxDD": 0.0,
          "delta_pct": 0.0,
          "delta_sharpe": 0.0,
          "false_signal": 224,
          "generic": "bh",
          "hit": 0
        }
      ],
      "hma_semantics": "ta.hma 20 = WMA(2*WMA(s,10)-WMA(s,20),4) with round(sqrt(20))=4, half=10; ta.crossover = prev<=8.5 & curr>8.5, ta.crossunder = prev>=0 & curr<0, OR independent not conflated; request.security D close = TradingView daily close UTC-naive trading days only; available_at close, next_close execution",
      "no_code_fix": "backtest/spx_breadth_low.py already Pine-correct (HMA/crossover tick-for-tick); no implementation change required — audit documents delta and retains prior 18 execution triggers as history payload truth",
      "pine_verbatim": "s5fi = request.security(\"S5FI\", \"D\", close)\ns5fi_hma = ta.hma(s5fi, 20)\ns5fi_low = input.float(8.5, \"S&P 500 Breadth Low\")\ns5fi_mega_low = input.float(0, \"S&P 500 Breadth Mega Low\")\ns5fi_crossover = ta.crossover(s5fi_hma, low)\ns5fi_megalow_hit = ta.crossunder(s5fi_hma, s5fi_mega_low)\nspx_breadth_buy_signal = s5fi_crossover or s5fi_megalow_hit",
      "pinned_fixture": "HMA logic pinned via backtest/spx_breadth_low.py hma()/wma() and spx_breadth_buy_signal() crossover/crossunder on hand-computed small series (e.g., 2008-01-25 13.88 hma 8.22 → 2008-01-28 21.22 hma 9.57 cross true; 2008-10-09 0.568 → 2008-10-10 -1.48 crossunder true) — offline tests pass",
      "provenance_hashes": "instruments INDEX:S5FI 4956 2006-12-29→2026-08-11 TV WS, __SYNTH_SPXBREADTH50__ 6896 1999-03-05→2026-08-04, SPY 8428 1993-01-29→2026-07-24; provenance via backtest.spx_breadth_low.provenance_record() metadata_only; DB offline replay without fetch",
      "research_narrative": [
        {
          "heading": "Generic opposite-signal harness",
          "text": "S&P 500 breadth low HMA20 8.5/0 Pine buy impulse (ta.hma WMA(2*WMA10-WMA20,4), ta.crossover prev<=8.5 & curr>8.5, ta.crossunder prev>=0 & curr<0, OR independent, hw20 fixed, 18 triggers SPY-aligned 224 active 4.55%) blended with generic defensive via OR override (long if either generic long or signal active) — each head-to-head generic-only vs signal+generic on same window/costs/lag via BacktestConfig.allocatesmartly() next_close 10bps; deltas SMA50 76.3% (CAGR +3.07% Sharpe +0.14 MaxDD +8.22% hit 198/false 26), SMA200 72.8% (CAGR +3.09% Sharpe +0.07 MaxDD -2.09% hit 204/false 20), cross 44.9% (CAGR +2.09% Sharpe +0.05 MaxDD -0.00% hit 179/false 45), trailing10 80.4% (CAGR +3.29% Sharpe +0.10 MaxDD -0.64% hit 186/false 38), trailing15 73.7% (CAGR +3.05% Sharpe +0.12 MaxDD +4.04% hit 160/false 64), trailing20 59.0% (CAGR +2.60% Sharpe +0.09 MaxDD +6.72% hit 110/false 114), trailingATR3x 61.5% (CAGR +2.51% Sharpe +0.20 MaxDD -2.35% hit 224/false 0), trailingVol2x 61.5% (CAGR +2.48% Sharpe +0.26 MaxDD -1.07% hit 224/false 0), BH 0.0% (CAGR +0.00% Sharpe +0.00 MaxDD +0.00% hit 0/false 224) — window 2007-01-03→2026-07-24 same window/costs/lag next_close +10bps L20 S5FI 4956/224 active 4.55% tradingview close_only offline"
        }
      ]
    },
    "tax_analysis": {
      "ltcg_pct": null,
      "note": "Experiment parity stub: no taxable wrapper; see strategy tax_analysis for methodology",
      "schema_id": "tax-analysis/v1",
      "stcg_pct": null
    },
    "taxable_stats": null,
    "title": "S&P 500 breadth low Pine HMA20 8.5/0 fidelity re-audit",
    "trading_costs": {
      "avg_daily_turnover": 0.00504,
      "avg_yearly_fees": 0.00127,
      "basis": "monthly_proxy",
      "cost_bps_one_way": 10.0,
      "fee_bps": 10.0,
      "n_bars": 2,
      "schema_id": "trading-costs/v1",
      "slippage_bps": 0.0,
      "total_costs": 1e-05
    },
    "verify": {
      "as_cagr": null,
      "as_stats": null,
      "cagr_delta": null,
      "gates": null,
      "last_verify_at": null,
      "monthly_bias": null,
      "monthly_corr": null,
      "monthly_mae": null,
      "n_months": null,
      "ours_cagr": 0.0,
      "ours_stats": {
        "ann_return": 0.0,
        "sharpe": 0.0,
        "sortino": 0.0
      },
      "passed": null,
      "status": "not_applicable",
      "verify_status": null
    },
    "visualizations": [
      {
        "data": {
          "labels": [
            "2007-01-01",
            "2026-08-04"
          ],
          "note": "Aligned window, both rebased to 1.0 at start for fair comparison"
        },
        "title": "Equity vs S&P (aligned, rebased to 1.0)",
        "type": "equity_vs_spy"
      },
      {
        "data": {
          "note": "Triggers when overlay takes over base strategy"
        },
        "title": "Signal timeline (sparse triggers)",
        "type": "signal_timeline"
      }
    ]
  },
  "generated_at": "2026-09-17T04:12:25Z",
  "id": "qm-kdnj.1",
  "schema_id": "experiments/v1",
  "schema_version": 1
}
