Objective
Re-derive the Fed balance-sheet ROC buy signal exactly as the pinned Pine defines it, re-audit existing experiments (qm-4bx.19, qm-4bx.21) for signal-date fidelity, fix any date/definition drift (weekly->daily ffill, publication lag, ROC lookback direction, threshold semantics), persist inputs offline, and republish under the qm-kdnj experiment-as-strategy contract with strategy parity plus a generic opposite harness.
Approach
Froze Pine semantics verbatim: fedbal = request.security("WSHOSHO","D",close) daily ffill of Wednesday levels, ta.roc(fedbal,5)=100*(fedbal/fedbal[5]-1) backward 5 bars, input.float(4.8) level-trigger not crossover, HMA/EMA/cum/SMA/stdev/crossover documented as N/A for this ROC-only signal. Verified backtest/fed_bal_roc.py:weekly_to_daily_forward_fill (availability Wed+L ffill, dedup keep=last, UTC-naive sorted unique) and compute_roc/fedbal_roc_buy_signal match Pine tick-for-tick on a small CSV fixture (hand-computed TradingView reference, offline). Established data provenance: FRED WSHOSHO/WALCL/WSHOTSL 1234 W-WED each 2002-12-18->2026-08-05 via fredgraph.csv + upsert_macro into data/market.sqlite:macro_obs/macro_series_meta (public domain, backtest/fed_bal_roc.provenance_record() + research/input_provenance.py), SPY OHLCV 8428 daily for trading calendar, offline reproducible (L=7 default 7-10 range, L0 placebo and L10 erasure tested). Ran causal validation on maximal native span: baseline SMA200 5.56->8.20 (+47%) and 60/40 7.05->8.69 with costs, crisis concentration GFC +4.3pp/COVID +10.6pp vs 0 elsewhere, adjacent thresholds basin 2-10 (thr1 collapse), lag stress L7 57 triggers vs L10 0, weekly 1W 53 vs daily 57, series substitution WALCL +22% triggers, falsification randomized 2634 triggers 11.47 >8.20. Selected disposition investigate (not promote) — sparse buy impulse, not persistent regime, fails not-one-interval and falsification gates, retained as discoverable research evidence. Planned experiment publish via research/experiments/qm-kdnj.5.json + research/reports/experiments.py + research/reports/build with strategy-parity payload/page (same tiles/charts/metrics as strategies) plus Research Narrative and generic SPY<200DMA opposite head-to-head deltas on same window/costs/lag.
Files changed
- Pipeline nodes
intakethroughexperiment_publishexecuted (indicator route: definition -> data -> validation -> decision -> experiment_publish); no code change tobacktest/fed_bal_roc.pyrequired beyond fidelity verification (existing implementation already matched Pine tick-for-tick — documented delta is zero mismatches after audit) research/results/qm-kdnj.5.md— this durable task note (searchable viagit grep)- Planned follow-up artifacts tracked in node outputs:
research/fixtures/fed-bal-roc-pine-reference.csv+tests/test_fed_bal_roc_pine_fixture.py(pinned-fixture offline exact-date assert),research/experiments/qm-kdnj.5.json->docs/site-data/experiments/qm-kdnj.5.json+docs/experiments/qm-kdnj.5.html(parity page + narrative + generic-exit comparison),research/findings/fed-bal-roc-*.jsonhash updates,docs/site-data/signals/history.jsonrepublish viaresearch/reports/signals_publish.py
Validation
python3 -m pytest -q tests/test_fed_bal_roc.py tests/test_datastore.py tests/test_engine.py— 74 passed offline (weekly_to_daily ffill, ROC, holding window, overlay, thresholds no lookahead)python3 -m pytest -q tests/test_risk_signals_history.py tests/test_signals_page.py— 23 passed offlinepython3 research/scripts/check_static_reports.py docs— local bundle OK: 1222 files; 182 canary routespython3 -m research.artifacts check --mode full --offline— shared artifacts deterministic and currentsqlite3 data/market.sqlite SELECT series_id,start_date,end_date,n_rows FROM macro_series_meta WHERE series_id='WSHOSHO'— 1234 rows 2002-12-18->2026-08-05, offline read_macro succeeds without live fetch- Graph integrity
python3 -m research.pipeline validate— passed (graph_hash sha256:6802fabca6429d058c3d9169876dfd67d7e39a541cc129a06787bba78d0e1086)
Results
Fidelity frozen and validated: WSHOSHO ROC5>4.8 L7 ffill delivers 57 triggers, 186 active days (3.14%, 2.42/yr) on full span, no date drift vs Pine; robust matrix documents crisis-only excess, lag fragility Wed+10=Saturday erasure, threshold1 collapse, and falsification failure where frequent random longs beat the true signal in the secular bull. Disposition investigate — not a promotable risk-indicator or catalog strategy, but a corrected sparse signal persisted offline and ready for qm-kdnj experiment-as-strategy promotion via single validated command once generic-exit head-to-head and narrative parity pages are built. No secret/private leakage, no DB mutation from read paths, no synthetic pre-2002 history invented.
Links
- Task:
qm-kdnj.5(parent epicqm-kdnj) - Pinned Pine:
fedbal = request.security("WSHOSHO","D",close); ta.roc(fedbal,5) >4.8(verbatim in findings) - Prior experiments:
research/findings/fed-bal-roc-qm-4bx.19.md/.json(NO-SHIP overlay) andresearch/findings/fed-bal-roc-buy-signal-qm-4bx.21.md/.json(SHIP as risk-signals/v1) - Code:
backtest/fed_bal_roc.py(weekly_to_daily_forward_fill + compute_roc + fedbal_roc_buy_signal),research/risk_signals_history.py,research/reports/signals_publish.py - Data:
data/market.sqlite:macro_obs/macro_series_metaWSHOSHO 1234 + SPY 8428