Stream tick-by-tick data
subscribe_tick_by_tickStart recording real-time trades, bid/ask changes, or midpoints for a contract into a buffer you can page through later. Select Last, AllLast, BidAsk, or MidPoint tick types for market data capture.
Instructions
Start recording every trade, quote change or midpoint of one contract into a ring buffer.
get_subscription_data returns the buffered ticks oldest first (use its `since` and
`limit` to page). Times are when the tick reached this server (UTC). IBKR allows
only about 3 tick-by-tick streams at a time; this server refuses more. One stream
per contract and tick_type: subscribing again returns the same handle. Needs live
data and a market data subscription for the instrument (not available with delayed
data); errors 10189 and 10190 mean IBKR refused it or its limit is reached. Stop it
with unsubscribe.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contract | Yes | The instrument. A con_id alone is unambiguous; otherwise give symbol and sec_type, plus expiry, strike and right for options. | |
| tick_type | Yes | Last: trades reported to the consolidated tape. AllLast: every trade including odd lots and off-exchange prints. BidAsk: every change of the best bid or ask. MidPoint: every change of the midpoint. | |
| buffer_size | No | How many of the newest ticks the server keeps for you to read. | |
| ignore_size | No | BidAsk only: skip updates that change only a size. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | What it streams for: the contract id plus parameters. | |
| kind | Yes | What streams: quotes, depth, tick_by_tick, realtime_bars, bars, scanner, news_bulletins, news or display_group. | |
| contract | No | The instrument, when there is one. | |
| created_at | Yes | ||
| idle_ttl_s | Yes | Seconds without a read before it is cancelled. | |
| deduplicated | No | True when an identical stream was already open and its handle was returned instead of opening a second one. | |
| subscription_id | Yes | Handle for get_subscription_data and unsubscribe. |