11 Commits (main)

Author SHA1 Message Date
I Luk Kim 190e395d66 Rebuild experiment index after cleanup; add v8.55 composed-gld config
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
I Luk Kim 126445ae0e Promote v9.5.36 PEAD champion + prune experiments to 3-tier set; ORB soft-day parity; TGTC infra
- v9.5.36 promoted: megacap reaction_min 0.02→0.03 on v9.5.20 cap=0.70 base; Full 13,244%/MDD 11.67%/Sharpe 3.579/OOT 304%; clean Pareto win
- Pruned 130 experiment configs → keep 3 (v9.4.5 max-return, v9.5.36 balanced/champion, v9.5.18 cap=0.55 conservative); rebuilt index
- PEAD engine probes: low_vol anomaly + breakout_52w (retained as falsification probes; not promoted)
- Risk analysis: 11.67% MDD confirmed structurally HYMC (6-day giveback, not controllable); per-name cap sweep on next_open_long/reaction_close falsified (0 MDD impact)
- ORB: port soft-day primary-trigger filter to live engine (6-gate parity with simulator)
- TGTC trader infrastructure + advisor service (new)
- ORB v46/v49 sweep configs, intraday scripts, docs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
I Luk Kim f1782f5fd3 Add xsmom disk cache + promote v9.3.2b as champion, retire v9 sweep configs
- New: libs/backtest/xsmom_cache.py — disk cache for xsmom ranked-universe
  per rebalance date; keyed by snapshot fingerprint + param hash; top_n is
  NOT in key so v9.3.1 (top20) and v9.3.2c (top10) share one cache file
- libs/backtest/cross_sectional_momentum.py — add cache= param to
  build_candidates(); hit path skips 900-symbol scan; miss path writes ranked
  rows post-quality-gate to cache buffer
- libs/backtest/snapshot_store.py — expose snapshot_dir attribute; propagate
  through slice_by_date_range() so runner always has the path
- apps/backtester/run.py — wire up XsmomRankCache per engine (lazy init,
  flush after simulation loop); cache is no-op when snapshot_dir is None
- configs: add return_max_long_v9.3.2b_fc.json (SQS 93.5 champion,
  ER days[2,8]); remove all other v9 sweep variants from .index.json

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
I Luk Kim 9e622c6614 Investigate compound mode: V23 is absolute champion in all modes
- V23 pure compound (live-equivalent): 200d +148.13% DD-14.23%, 400d +209.41% DD-17.35%
- Hybrid V2 compound tested: 200d +175.41% looks promising but 400d +181.71% DD-23.72%
  loses to V23 by -27.7pp return AND -6.4pp worse DD → rejected
- Safe v9 compound 400d: +128.49% DD-14.43% — better DD but -81pp return vs V23 → rejected
- V23 tight governor compound 400d: +192.54% DD-17.32% — marginal gain, not worth config
- Live paper trader uses compound mode (engine.py:1816 session_equity = initial_equity + P&L)
- All improvement axes exhausted; V23 daily_reset declared TERMINAL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 months ago
I Luk Kim 65afc95c7e Clean up: reduce Oracle timeout, fix company endpoint, archive old v7/v15/v16 experiments
- libs/oracle_client/alpaca.py: reduce bar-fetch timeout 90s→15s (fail fast on Oracle outage)
- libs/oracle_client/client.py: add health_check_fast() for cheap liveness probe; fix health path
- libs/oracle_client/company.py + financial.py: use /api/v1/company/{symbol} (newer endpoint)
- libs/oracle_client/__init__.py: re-export AlpacaSnapshot/get_snapshot/get_snapshots at package level
- configs/experiments: delete archived v15.x, v16.x, v7.119–v7.358 experiment configs (superseded)
- README.md: fix absolute path → relative path for ORB docs link

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 months ago
I Luk Kim 3d3ac5cd0e Purge 1,062 obsolete experiment configs (v6~v19 R&D families)
Keep only active families:
- v7 (130 files): current champion lineage, #1 SQS 91.6
- v15 (3 files) / v16 (7 files): leaderboard #3/#4
- empty_strategy.json: web utility

Deleted families: v1.xxx, v6, v6new, v8, v9, v10, v11, v12, v13,
v14, v17, v18, v19 + all alias files (baseline_, conviction_, etc.)
+ parking_only_*, short_bearish_v1

Index rebuilt: 139 experiments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 months ago
I Luk Kim 236148de2e Remove momentum breakout sleeve (overfitting, valid -31%) and revert related code
- Delete v7.360-v7.363 experiment configs (rotation/momentum tests)
- Remove _schedule_momentum_breakout_candidates() from backtester run.py
- Remove MomentumBreakoutConfig from domain.py
- Delete momentum_calendar.py, momentum_screener.py, build_momentum_calendar.py
- Delete data/momentum_calendar/ parquet data

Valid period performance was -31.36% vs +152.4% baseline — sleeve is not viable
without walk-forward validation. Abandoning for now.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 months ago
I Luk Kim b3ba914a8d Optimize v7 strategy: v7.356 achieves CW 2159% + SQS 90.7 (Pareto improvement over v7.314)
Key changes from v7.314 baseline (CW 2012%, SQS 90.0):
- max_position_value_pct 15→25, non_a_tier_target_1_fraction 0.2→0
- max_daily_new_risk_pct 30→50 (via v7.330, CW champion 2148%)
- bullish_raised_recovery per_trade_risk_pct 0.71→0.55 (DD improvement)
- bullish_raised_recovery max_holding_days 12→10 (sweet spot, +98pp CW)

Result: v7.356 CW 2159% (+147pp), SQS 90.7 (+0.7), risk 66.2 (+2.9), robustness 94.3 (+0.5)
All metrics improved simultaneously — return increase AND DD reduction achieved.

Also includes: web UI updates, pipeline scripts, v16/v17/v18/v19 experiment pruning,
Form4 preset additions, snapshot registry updates, domain.py enhancements.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 months ago
I Luk Kim 5496059b6c Add v7.120 composed GLD experiment updates 4 months ago
I Luk Kim e38c314a09 Add ownership/risk-off sleeves, v17-v19 experiments, and web app restructure
New features:
- Ownership 13D/13G residual-cash sleeve with PIT calendar and quality filters
- Risk-off alpha sleeve (GLD/DBC rotation on crisis regime signals)
- Crisis relay target in parking: evaluates before defensive relay
- Bearish symbol allocation split (bearish_alloc_pct + sgov remainder)
- Alternative defensive ETF candidate (cash_parking_defensive_alt_symbol)
- Composite eval and engine ablation tools
- experiment and overfit CLI apps

New experiments:
- v17.x series (v17.1 champion SQS 78.4; v17.5–v17.129 exhausted)
- v18.x and v19.x families from v12.8 OOT defense branch
- v7.119 composed variants (idle alpha + ownership + risk-off sleeves)
- parking_only configs: bufb, jepq, merix, regime_tiered
- empty_strategy baseline config

Web app:
- Restructured into routers/services modules (experiments, leaderboard, runs, sqs, docs)
- Ownership sleeve and risk-off sleeve controls in backtest UI
- Frontend: ComposeStrategy page, tradeSleeves lib, idle decomposition display

Research tools:
- Ownership 13D/13G probe and PIT cache builder
- Dividend capture probe and cache builder
- Insider Form4 idle alpha probe
- Alternative ETF parking probe, put-spread overlay probe
- Wikimedia low-attention and peer-relative idle alpha probes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 months ago
I Luk Kim f2113b7e06 Fix cash parking phantom-money bug + live engine parking liquidation for events
Backtester (run.py):
- cash_available = (self._cash + parking_value) * multiplier caused trades to be
  approved even when self._cash ≈ 0 (all money in SGOV/QQQ).  Trades executed
  by deducting from self._cash → negative cash (phantom money).
- Fix: after simulate_entry, if self._cash < actual trade cost and parking exists,
  call _liquidate_parking_for_cash(shortfall) before deducting from cash.
- Verified: 2022-2026 backtest with qqqm_low_dd shows 0 cash_negative events.

Live engine (engine.py):
- Add _parking_liquidate_for_event(): frees parking cash to fund event entries.
  SGOV (virtual) reduces entry_value in DB; QQQM/QQQ sells real shares via broker.
- Both entry loops (engines mode + flat/reaction_close mode) now attempt parking
  liquidation when plan.skip_reason == "insufficient_cash" before giving up.

Also includes prior session work (accumulated since last commit):
- 6 novel parking gate signals: VRP, Market Temperature, Hurst exponent, Rolling
  Kurtosis, Return Autocorrelation, SPY-QQQ Correlation (composite risk score v2)
- QQQM parking symbol support (lower expense ratio vs QQQ)
- Snapshot auto-refresh + bar extension cache (pickle) to avoid 10-min re-fetches
- Bar extension clamps to last market-closed date (ET 4PM check)
- fithia2 refresh command; --no-refresh flag for paper backtest
- Paper backtest macro extension beyond last event date (parking-only periods)
- parking_state DB schema: 7 new columns (peak_price, gate_in_sgov,
  committed_target, pending_target, pending_days, sgov_entry_value, sold_today)
- Live engine: target confirmation (2-day), top-up drawdown gate, trailing stop,
  SGOV interest accrual, full 6-signal gate evaluation
- New PARKING_PRESETS: qqqm_low_dd, composite_v2, vv_24_vrp8, vt_24_t13, etc.
- Web GUI / CLI result parity fix (Oracle URL via get_settings().stock_oracle_url)
- Force-close uses last_exec_date (has bar data); parking liquidates at last_date

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5 months ago