3 Commits

Author SHA1 Message Date
jgrusewski
3f321bb4bf fix: broker-data sanity-check + drop incomplete intraday bar (two live-only bugs)
(1) IBKR paper reports summary fields (cash/GrossPositionValue) inconsistent with actual positions
(found: $141k/13% gap, fills+positions are ground truth). Bot now cross-checks NLV vs cash+position-
market-value, WARNs on >2% gap, sizes on the CONSERVATIVE NLV (never inflates), and a gate refuses to
trade if the gap exceeds MULTISTRAT_DATA_TOL (default 25%).
(2) build() included today's INCOMPLETE intraday bar when run mid-session -> spiked vol estimate ->
halved the leverage (1.0->0.5) -> would have sold half the book as churn at the 14:35 cron. Now drops
today's partial bar; uses completed closes only (matches the daily-close backtest). Verified live:
leverage back to 1.0, book recognized on-target (in_band), no spurious orders.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 16:01:04 +02:00
jgrusewski
8ebb65f27e fix: NaN-safe correlation de-risk in book_series (zero-variance windows)
np.corrcoef on a window where a vol-normalized stream is constant (warmup / non-moving stream)
divided by zero std -> RuntimeWarning + NaN in the corr matrix -> ac=NaN -> propagated via chist
into the z-score and could poison leverage L and book with NaN (silent corruption). Fix: correlate
only streams with std>0 in the window, nansum over the actual valid count, fall back to ac=0 when
<2 vary. Verified: no RuntimeWarning (tested with warnings-as-errors), no NaN, identical L/weights.
Affects all scripts importing book_series + the cluster ConfigMap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 00:29:36 +02:00
jgrusewski
ba7e7dca79 feat: adaptive multi-strat paper-forward harness (spec Phase 1)
Full 6-stream adaptive book live paper-forward: SPY/IEF/GLD/PDBC/DBMF + BTC-USD via Yahoo, with
edge-decay trust allocation + adaptive risk layer (EMA vol/Kelly-floor/self-recovering DD/z-score
corr), unlevered. status/run/weights modes, forward-start, idempotent, catch-up. Cron 12/15/18 UTC.
Live weights sensible: trust down-weights bond(7%)+crypto(2%), gold/commod/trend healthy(~23%).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 20:02:51 +02:00