equity: Parse live historicals results[].bars + open_price #18
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
CT113 Tue Sep 8 (normal RTH) paper session: 0 fills, decision lines show
vwap/sma/rsi/atr=0, massentry/insufficient_dataskips. Labor Day empty was expected; Tuesday is not.decideskips withinsufficient_datawhen!r.VWAP.IsPositive() || !px.IsPositive(). VWAP comes fromtools.FromQuoteAndBarsover historical bars — empty bars or all-zero OHLC/volume → VWAP stays 0 even when quotes/lastare fine.Likely cause (verify with live keys)
equity.parseHistoricalsonly unmarshals:Classic Robinhood historical points use
open_price/high_price/low_price/close_price. FixtureTestHistoricals_rhntestuses 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/ nestedhistoricalswithoutdata_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
histPointJSONacceptsopenoropen_price(same for high/low/close); keep volume aliases if any.data_points/historicals/results) without breaking existing fixture.*_pricenames; optional alternate envelope.go test ./...green.equity: Accept open_price aliases in historicalsOut 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 oncewith prior session that has volume): decision lines should show non-zerovwapwhen bars exist;insufficient_datamust not be mass-default on a normal open day.Revert
git revert. No DB.CT113 evidence (Jerry, Tue 20260908-dry)
last>0,vwap=sma=rsi=atr=0,session_high=session_low=0, reason=insufficient_data.bars=in log yet (tradey#4).open_price/high_price/low_price/close_priceand widen envelopes; if Jerry lands a live key dump mid-flight, match it.Also note open-window 400s early:
end must be after startwhenOpen==now(tradey uses PriorSession path on!Open.Before(now)including equality) — separate tradey fix; do not hard-require that for this PR.Confirmed live wire (Jerry CT113, Tue RTH AAPL)
Top-level:
data,guidedatakeys:results(nothistoricals)results[0]keys:bars,bounds,interval,symbolbars_len=30bars[0]keys:begins_at,open_price,high_price,low_price,close_price,session,volumeSample:
begins_at=2026-09-08T13:30:00Z open_price=317.39 … volume=1.192968e+06 session=regCurrent
parseHistoricalsexpects{historicals:[{symbol,data_points:[{open,high,low,close,volume}]}]}→ PARSED_BAR_COUNT=0 (silent empty) on this body.Required parse
wire.Unwrapalready peelsdata.resultsand legacyhistoricals.barsand legacydata_points.open_price/high_price/low_price/close_priceand short names.equity: Parse results[].bars with open_price historicalsDo not merge yourself.
equity: Accept open_price aliases in historicals parseto equity: Parse live historicals results[].bars + open_priceAutopsy 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.Mid-RTH confirm (Jerry, Tue 14:00–15:00Z)
bars_len=12on wire (results[].bars+*_price);historicals/data_pointsabsent;Equity.Historicals PARSED_BAR_COUNT=0on same call. Not empty MCP — pure parse miss.