Hedge Infrastructure — Bar Cache, Data Hierarchy, Chart Updates (2026-02-22)
P2 - MediumHEDGE PLATFORM INFRASTRUCTURE UPDATES (2026-02-22)
DATA PROVIDER HIERARCHY (Henry-corrected):
Schwab FIRST for ALL data (daily AND intraday) → Alpaca secondary → yfinance last resort.
Unified provider: backend/app/services/data_provider.py
Schwab intraday: 1m=freq1, 5m=freq5, 15m=freq15.
HISTORICAL BAR CACHE (Postgres):
Table: market_bars_2m (symbol, timestamp, OHLCV, source, unique on symbol+timestamp)
Service: backend/app/services/bar_cache.py
Smart fetch: DB first → Alpaca backfill in weekly chunks → store in Postgres
24 tickers cached: ~1.97M 2m bars, 270 trading days (Feb 2025-Feb 2026)
5 momentum tickers: 30 months (Aug 2023-Feb 2026): NVDA 293K, TSLA 297K, AVGO 208K, GOOG 228K, AMZN 261K
APIs: GET /bar-cache/stats, POST /bar-cache/fetch
CHART UPDATES:
- Replaced 1m/3m/5m with single 2m chart (3 days of 1m Schwab data, client-side aggregation)
- period=3 days needed because period=1 expires on weekends
- Default indicators: SMA20 + SMA200 (was SMA20+SMA50)
- Timestamps in Pacific Time (epochToTimestamp shifts UTC→PT, handles DST)
FRONTEND:
- /strategy/opening-power page with Scanner, Backtester, Rules tabs
- sidebar nav updated under Strategy section
Created: Sun, Feb 22, 2026, 3:46 PM by bob
Updated: Sun, Feb 22, 2026, 3:46 PM
Last accessed: Mon, Mar 16, 2026, 8:35 AM
ID: 16fd20f7-cfa4-4ed8-b352-77f1232908a0