Skip to content

Populate NewsTick with its originating contract#214

Open
mahimn01 wants to merge 4 commits into
ib-api-reloaded:nextfrom
mahimn01:tick-news-contract
Open

Populate NewsTick with its originating contract#214
mahimn01 wants to merge 4 commits into
ib-api-reloaded:nextfrom
mahimn01:tick-news-contract

Conversation

@mahimn01
Copy link
Copy Markdown

Fixes #110.

tickNews was receiving the market-data reqId as _reqId (unused), so NewsTick events came out with no way to tell which symbol a headline belonged to when a consumer had multiple streaming-news subscriptions active at once.

A new _snapshotContractForReqId helper resolves the reqId via reqId2Ticker (falling back to _reqId2Contract), and tickNews attaches a Contract.recreate(...) snapshot to the emitted NewsTick. Includes a unit test covering the happy path, the _reqId2Contract fallback, and the no-op path when the reqId is unknown.

Matches the shape we converged on in the thread, with reqId omitted for consistency with the other tick-style events.

mattsta and others added 4 commits April 7, 2026 20:39
Constructed to support both poetry and uv at the same time currently.

Fixes ib-api-reloaded#204
tzdata should always just be the newest we can pull; there's no sense in
keeping older versions through time.

Fixes ib-api-reloaded#209
Fixes ib-api-reloaded#210
apparently pandas doesn't build under pypy reliably, so avoid it from
installing automatically in incompatible environments.
tickNews was receiving the market-data reqId as `_reqId` (unused), so
emitted news headlines had no way to signal which symbol they belonged to
when more than one subscription was streaming news at once.

Look up the reqId in `reqId2Ticker` (falling back to `_reqId2Contract`)
and attach a `Contract.recreate(...)` snapshot to the `NewsTick`.

Fixes ib-api-reloaded#110
mattsta pushed a commit that referenced this pull request May 1, 2026
tickNews was receiving the market-data reqId as `_reqId` (unused), so
emitted news headlines had no way to signal which symbol they belonged to
when more than one subscription was streaming news at once.

Look up the reqId in `reqId2Ticker` (falling back to `_reqId2Contract`)
and attach a `Contract.recreate(...)` snapshot to the `NewsTick`.

Fixes #110
Fixes #214
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.

2 participants