Skip to content

Read Yahoo intraday bars from a day before the window - #76

Open
aphtechme wants to merge 1 commit into
longsurf-ai:mainfrom
aphtechme:yahoo-intraday-first-volume
Open

aphtechme wants to merge 1 commit into
longsurf-ai:mainfrom
aphtechme:yahoo-intraday-first-volume

Conversation

@aphtechme

@aphtechme aphtechme commented Nov 4, 2026 •

Copy link
Copy Markdown

Problem

The volume profile on Yahoo charts failed with:

Out-of-order input or committed revision in input 'bars' at root

Yahoo zeroes the volume of the first intraday bar of period1's trading day, even when period1 is before the session's open. After its first poll, the poller restarts two days before the newest bar. That can land exactly on an open, such as Monday 14:30 UTC for AAPL. The bar then comes back with volume 0, the Feed forwards it as a correction to a bar two days old, and Tea rejects it.

Reproduced live against Yahoo for AAPL 30m and 60m.

Fix

Intraday reads now start one day before the window instead of one interval. The zeroed bar then falls before the window and is filtered out. The 1m request still fits Yahoo's 7-day limit. Daily and coarser reads are unchanged.

Verification

  • New test: keeps the volume of a window's first bar at a session's open. It fails without the fix (volume 0) and passes with it.
  • server/data/providers/yfinance, server/feed and server/tea: 335 tests pass.
  • Live replay of Yahoo history plus polls through Tea's ordering rule on 1m–60m: no rejections.
  • just check does not pass locally, for reasons outside this change: Prettier flags an untracked file under docs/superpowers/, and many app UI test files fail.

🤖 Generated with Claude Code


Devin Review

Yahoo zeroes the volume of the first intraday bar of period1's trading
day, even when period1 precedes the session's open. After its first
poll, the poller restarts two days before the newest bar, which can land
on an open; the zeroed bar then reached Tea as a revision of a committed
bar, and the visible-range volume profile failed with "Out-of-order
input or committed revision in input 'bars' at root". Intraday reads now
start a day earlier, so that bar falls before the window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

// Yahoo zeroes the volume of the first intraday bar of period1's trading
// day, even when period1 precedes that bar, such as before a session's
// open. Starting a day earlier leaves that bar before the window.
const lead = interval < Day ? Day : 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Monday opening bars retain zero volume

When a window starts at Monday's open, lead puts the request on Sunday without an earlier trading bar. Yahoo can still zero Monday's opening volume, causing the poll correction to fail in Tea.

Learn more

Yahoo can zero the first intraday bar of the trading day represented by period1. A fixed 24-hour lead crosses one calendar day, not necessarily one trading session. When a Monday poll begins at the open, sourceStart lands on Sunday. Without weekend trading bars, the first returned session can still be Monday, so its opening volume can be zero. The poller forwards that correction through the Feed adapter, triggering the ordering failure this change targets. The new test models Saturday and Sunday bars, unlike an equity exchange.

Example: An AAPL 60m window starts Monday at 14:30 UTC. Its period1 becomes Sunday at 14:30 UTC; there are no Sunday AAPL bars. The Monday 14:30 bar remains the first session bar returned with zero volume, instead of retaining its actual volume.

Recommended fix: Choose a lead that guarantees an earlier trading session for the listing, including weekends and exchange holidays, or explicitly detect and retry a first-session bar with suspect zero volume using an earlier valid source window. Add a fixture with no weekend bars and a Monday opening bar.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant