equity: Parse live historicals results[].bars + open_price #18

Closed
opened 2026-09-09 05:01:39 -05:00 by pike · 4 comments
Collaborator

Problem

CT113 Tue Sep 8 (normal RTH) paper session: 0 fills, decision lines show vwap/sma/rsi/atr=0, mass entry / insufficient_data skips. Labor Day empty was expected; Tuesday is not.

decide skips with insufficient_data when !r.VWAP.IsPositive() || !px.IsPositive(). VWAP comes from tools.FromQuoteAndBars over historical bars — empty bars or all-zero OHLC/volume → VWAP stays 0 even when quotes/last are fine.

Likely cause (verify with live keys)

equity.parseHistoricals only unmarshals:

open, high, low, close, volume, begins_at

Classic Robinhood historical points use open_price / high_price / low_price / close_price. Fixture TestHistoricals_rhntest uses short names, so CI stays green while live Agentic payloads can produce bars with timestamps but zero OHLC (or empty series if envelope differs: results / nested historicals without data_points).

Jerry is pulling CT113 evidence (keys + decision samples). Fold live key names into the same PR if they differ.

Goal

Parse live get_equity_historicals so OHLC+volume populate; paper VWAP can go positive on an open RTH day.

Acceptance

  1. histPointJSON accepts open or open_price (same for high/low/close); keep volume aliases if any.
  2. Widen series envelope if needed (data_points / historicals / results) without breaking existing fixture.
  3. Unit tests: short names (existing) + *_price names; optional alternate envelope.
  4. go test ./... green.
  5. PR to develop; do not merge yourself. Commit: equity: Accept open_price aliases in historicals

Out of scope

Live/place, knob values, tradey strategy.

Related

tradey may add bars= to decision logs in a sibling issue for observability — not required to unblock parse.

Re-prove (CT113 after merge/deploy MCP sibling + rebuild tradey)

During RTH (or make once with prior session that has volume): decision lines should show non-zero vwap when bars exist; insufficient_data must not be mass-default on a normal open day.

Revert

git revert. No DB.

## Problem CT113 Tue Sep 8 (normal RTH) paper session: **0 fills**, decision lines show `vwap/sma/rsi/atr=0`, mass `entry` / `insufficient_data` skips. Labor Day empty was expected; Tuesday is not. `decide` skips with `insufficient_data` when `!r.VWAP.IsPositive() || !px.IsPositive()`. VWAP comes from `tools.FromQuoteAndBars` over historical bars — empty bars or all-zero OHLC/volume → VWAP stays 0 even when quotes/`last` are fine. ## Likely cause (verify with live keys) `equity.parseHistoricals` only unmarshals: ``` open, high, low, close, volume, begins_at ``` Classic Robinhood historical points use **`open_price` / `high_price` / `low_price` / `close_price`**. Fixture `TestHistoricals_rhntest` uses short names, so CI stays green while live Agentic payloads can produce bars with timestamps but **zero OHLC** (or empty series if envelope differs: `results` / nested `historicals` without `data_points`). Jerry is pulling CT113 evidence (keys + decision samples). Fold live key names into the same PR if they differ. ## Goal Parse live get_equity_historicals so OHLC+volume populate; paper VWAP can go positive on an open RTH day. ## Acceptance 1. `histPointJSON` accepts `open` **or** `open_price` (same for high/low/close); keep volume aliases if any. 2. Widen series envelope if needed (`data_points` / `historicals` / `results`) without breaking existing fixture. 3. Unit tests: short names (existing) + `*_price` names; optional alternate envelope. 4. `go test ./...` green. 5. PR to develop; do not merge yourself. Commit: `equity: Accept open_price aliases in historicals` ## Out of scope Live/place, knob values, tradey strategy. ## Related tradey may add `bars=` to decision logs in a sibling issue for observability — not required to unblock parse. ## Re-prove (CT113 after merge/deploy MCP sibling + rebuild tradey) During RTH (or `make once` with prior session that has volume): decision lines should show non-zero `vwap` when bars exist; `insufficient_data` must not be mass-default on a normal open day. ## Revert `git revert`. No DB.
ash was assigned by pike 2026-09-09 05:01:39 -05:00
Author
Collaborator

CT113 evidence (Jerry, Tue 20260908-dry)

  • After open churn, ticks continue without hist errors ⇒ MCP call OK, but decision lines all day: last>0, vwap=sma=rsi=atr=0, session_high=session_low=0, reason=insufficient_data.
  • No bars= in log yet (tradey#4).
  • Strongly consistent with 0 usable bars after parse (empty series or OHLC aliases miss → zeros). Please still accept open_price/high_price/low_price/close_price and widen envelopes; if Jerry lands a live key dump mid-flight, match it.

Also note open-window 400s early: end must be after start when Open==now (tradey uses PriorSession path on !Open.Before(now) including equality) — separate tradey fix; do not hard-require that for this PR.

## CT113 evidence (Jerry, Tue 20260908-dry) - After open churn, ticks continue **without** hist errors ⇒ MCP call OK, but decision lines all day: `last>0`, `vwap=sma=rsi=atr=0`, `session_high=session_low=0`, reason=`insufficient_data`. - No `bars=` in log yet (tradey#4). - Strongly consistent with **0 usable bars** after parse (empty series **or** OHLC aliases miss → zeros). Please still accept `open_price`/`high_price`/`low_price`/`close_price` and widen envelopes; if Jerry lands a live key dump mid-flight, match it. Also note open-window 400s early: `end must be after start` when `Open==now` (tradey uses PriorSession path on `!Open.Before(now)` including equality) — separate tradey fix; do not hard-require that for this PR.
Author
Collaborator

Confirmed live wire (Jerry CT113, Tue RTH AAPL)

Top-level: data, guide
data keys: results (not historicals)
results[0] keys: bars, bounds, interval, symbol
bars_len=30
bars[0] keys: begins_at, open_price, high_price, low_price, close_price, session, volume

Sample: begins_at=2026-09-08T13:30:00Z open_price=317.39 … volume=1.192968e+06 session=reg

Current parseHistoricals expects {historicals:[{symbol,data_points:[{open,high,low,close,volume}]}]}PARSED_BAR_COUNT=0 (silent empty) on this body.

Required parse

  1. wire.Unwrap already peels data.
  2. Accept series under results and legacy historicals.
  3. Accept points under bars and legacy data_points.
  4. OHLC: open_price/high_price/low_price/close_price and short names.
  5. Fixture for live shape + keep old fixture green.
  6. Commit suggestion: equity: Parse results[].bars with open_price historicals

Do not merge yourself.

## Confirmed live wire (Jerry CT113, Tue RTH AAPL) Top-level: `data`, `guide` `data` keys: `results` (**not** `historicals`) `results[0]` keys: `bars`, `bounds`, `interval`, `symbol` `bars_len=30` `bars[0]` keys: `begins_at`, `open_price`, `high_price`, `low_price`, `close_price`, `session`, `volume` Sample: `begins_at=2026-09-08T13:30:00Z open_price=317.39 … volume=1.192968e+06 session=reg` Current `parseHistoricals` expects `{historicals:[{symbol,data_points:[{open,high,low,close,volume}]}]}` → **PARSED_BAR_COUNT=0** (silent empty) on this body. ### Required parse 1. `wire.Unwrap` already peels `data`. 2. Accept series under `results` **and** legacy `historicals`. 3. Accept points under `bars` **and** legacy `data_points`. 4. OHLC: `open_price`/`high_price`/`low_price`/`close_price` **and** short names. 5. Fixture for live shape + keep old fixture green. 6. Commit suggestion: `equity: Parse results[].bars with open_price historicals` Do not merge yourself.
pike changed title from equity: Accept open_price aliases in historicals parse to equity: Parse live historicals results[].bars + open_price 2026-09-09 05:04:25 -05:00
Author
Collaborator

Autopsy counts (Jerry, 20260908-dry)

hist_err=10, before_trade=8, insufficient_data=276, nonzero_vwap=0.

Primary remains: live data.results[].bars + *_price → parse 0 bars. Legacy fallback OK; live fixture required.

## Autopsy counts (Jerry, 20260908-dry) `hist_err=10`, `before_trade=8`, `insufficient_data=276`, `nonzero_vwap=0`. Primary remains: live `data.results[].bars` + `*_price` → parse 0 bars. Legacy fallback OK; live fixture required.
Author
Collaborator

Mid-RTH confirm (Jerry, Tue 14:00–15:00Z)

bars_len=12 on wire (results[].bars + *_price); historicals/data_points absent; Equity.Historicals PARSED_BAR_COUNT=0 on same call. Not empty MCP — pure parse miss.

## Mid-RTH confirm (Jerry, Tue 14:00–15:00Z) `bars_len=12` on wire (`results[].bars` + `*_price`); `historicals`/`data_points` absent; `Equity.Historicals PARSED_BAR_COUNT=0` on same call. Not empty MCP — pure parse miss.
linus closed this issue 2026-09-09 05:11:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: s1d3sw1ped/robinhood-agentic-mcp#18