3 Commits (8f0f99bdda69823adb6de7878d95078de79c5c29)

Author SHA1 Message Date
I Luk Kim 8f0f99bdda Fix daily bar rebuild to use market-hours close; clean ORB simulator debug code
Two fixes:
1. _rebuild_daily_from_intraday_cache now filters to regular market hours
   (9:30–16:00 ET) before computing OHLCV. Previously used bars[-1] which
   included after-hours data, distorting prev_close for gap calculations.
   Root cause of V23 regression: HIMS Aug-4 after-hours drop to $54.81
   made it appear as a +0.89% gap on Aug 5 instead of the correct -12.85%
   gap (from $63.45 market close), causing it to fail min_abs_gap_pct filter.
   V23 with fix: +109.32%, WR 58.1%, Sharpe 3.01, DD -12.91%

2. Remove temporary debug instrumentation (HIMS/2025-08-05 trace blocks)
   that was left in orb_simulator.py during regression investigation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 months ago
I Luk Kim 86419beeb0 Fix ORB intraday data pipeline and consolidate strategy configs
- screener: switch from non-existent single-ticker endpoint to multi-ticker
  /alpaca/intraday batch calls (grouped by date, chunk ≤ 75); fixes 0-trades
- cache: bump version 2→3 to invalidate stale IEX Parquet files
- oracle_client: add get_multi_intraday_bars_today() for IEX real-time feed
- paper_trader: use /alpaca/intraday/today for live sessions, /alpaca/intraday
  for historical (SIP)
- intraday.py: define _BUILTIN_STRATEGIES={} to fix /api/orb/strategies import
- delete orb_p1–p10_winner + variant configs; add strategies/orb_default.yaml
  (Phase 10 params) as the single registered web strategy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 months ago
I Luk Kim 564bcba27c Add ORB pre-market screening and fix Oracle/Alpaca reliability bugs
- Add run_pre_screen() at 9:20 ET: fetch daily bars + enrichment + quality filter
  before market open, narrowing universe for faster orb_detect intraday fetch
- run_orb_detection() uses cached pre-screen data when available; falls back to
  full pipeline if pre_screen missed (late start, failure)
- Add _last_trading_day() helper to skip weekends/holidays for bars_end,
  preventing Alpaca 502 on Mondays (today-1 = Sunday was causing failures)
- Fix Oracle client chunk_size 300→75: Alpaca rejects 100+ ticker URL requests
- Add pre_screen event to build_schedule() at 9:20 ET and dispatch in _run_trading()
- run_session_now() runs pre_screen before orb_detect for efficiency
- Add ORB daemon, engine, models, state, screener, and intraday strategy configs
- Add intraday library (libs/intraday/) and web routes for ORB/intraday trading

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