chart/tests
Chris Amow d526001742 Add the Schwab live source: real-time /ES minute bars
Verified against a live account before and after writing it. CHART_FUTURES
delivers one true-OHLCV minute bar per symbol per minute, LEVEL_ONE_FUTURES
reports delayed: false, and consecutive bars arrived sixty seconds apart through
the production code path.

Yahoo stays. Schwab serves no futures history whatever, so seed_source resolves
to Yahoo even when SEED_SOURCE=schwab is asked for — the pairing is the intended
configuration rather than a fallback. The symbols differ, ES=F against /ES, so
Settings.live_symbol picks the live one while seeding always uses Yahoo's.

Three findings worth keeping, each of which cost a round trip:

- get_quote() singular returns the wrong instrument entirely. It puts the symbol
  in the URL path, where the leading slash is normalised away, so /ES resolves to
  Eversource Energy at $72 and returns HTTP 200 with a populated body. Only
  get_quotes() plural, which passes symbols as a query parameter, returns the
  future. A 200 is not evidence; assetMainType is.
- Streaming requires the Accounts and Trading product. StreamClient.login() reads
  /trader/v1/userPreference for its socket URL, and that path does not exist in
  Market Data Production.
- /ES resolves to the active contract on Schwab's side, so the contract roll
  handling the plan left open needs no code.

The stream drops the oldest queued message rather than stalling the socket, and
surfaces a dead pump task instead of waiting forever on a queue nothing fills.
schwab-py moves into requirements.txt, imported only when LIVE_SOURCE=schwab.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 05:23:20 -05:00
..
fixtures Add implementation plan for /ES multi-timeframe confluence chart 2026-08-09 20:31:40 -05:00
test_aggregator.py Implement M2 session-aware aggregation 2026-08-09 20:41:36 -05:00
test_alerts.py Stop re-alerting when price crosses a level 2026-08-10 01:51:54 -05:00
test_asset_versioning.py Version static assets so a fixed bug stops reproducing in an open tab 2026-08-10 04:29:56 -05:00
test_auth.py Guard that the OAuth callback stays reachable under CHART_AUTH_TOKEN 2026-08-10 04:50:12 -05:00
test_bar_space.py Price trendlines across bars, add one-shot alerts, collapse layers, drop 1h MAs 2026-08-10 04:15:05 -05:00
test_confluence.py Fix trendline deletion while typing, audio leak, prefs drift, cluster payload 2026-08-10 00:17:40 -05:00
test_horizontals.py Add prior-day levels and session VWAP; fix alert repetition they exposed 2026-08-10 00:36:21 -05:00
test_manual_lines.py Remove the 4h timeframe 2026-08-10 00:43:47 -05:00
test_moving_averages.py Implement M3 projected daily moving averages 2026-08-09 20:44:11 -05:00
test_price_alerts.py Add a price alert input 2026-08-10 02:09:14 -05:00
test_replay.py Implement M0 Yahoo market data and replay 2026-08-09 20:36:13 -05:00
test_runtime_alerts.py Move alert evaluation server-side so push works without a browser open 2026-08-10 00:48:03 -05:00
test_schwab_callback.py Add the OAuth callback endpoint at /api/qt 2026-08-10 04:45:31 -05:00
test_schwab_source.py Add the Schwab live source: real-time /ES minute bars 2026-08-10 05:23:20 -05:00
test_session.py Remove the 4h timeframe 2026-08-10 00:43:47 -05:00
test_store.py Implement M1 live one-minute chart 2026-08-09 20:38:50 -05:00
test_vwap.py Add prior-day levels and session VWAP; fix alert repetition they exposed 2026-08-10 00:36:21 -05:00
test_yahoo.py Implement M0 Yahoo market data and replay 2026-08-09 20:36:13 -05:00