@@ -236,6 +236,80 @@ Let's try a low-latency snapshot request for the most recent option quote availa
236
236
0 57599990 1 1 6.05 50 63 46 6.55 50 2022-12-16
237
237
```
238
238
239
+ ## Streaming
240
+
241
+ ### Preface
242
+
243
+ #### Definition
244
+
245
+ Streaming is defined as receiving continuous updates for trades or quotes throughout
246
+ the trading day. It is much more performant when compared to snapshots.
247
+
248
+ #### Responses
249
+
250
+ You must implement a callback method as shown in the first example below. Each time a
251
+ `` StreamMsg `` is received, this method will get called. A `` StreamMsg `` can either be
252
+ a trade or quote.
253
+
254
+ #### Limitations
255
+
256
+ The Pro tier has the ability to request a trade stream for every option contract in
257
+ existence and is able to have up to 15K quote streams. The Standard tier is only allowed
258
+ 5K combined quote / trade streams. Other tiers will not have access to streaming at this time.
259
+
260
+ ### Option Trades
261
+
262
+ Below requests to receive continuous updates for trades for 4 NVDA option contracts. Notice
263
+ that these options expire today, so you may need to change the expiration dates to a date
264
+ further in the future.
265
+
266
+ === "trade_streaming.py"
267
+
268
+ ```python
269
+ --8<-- "docs/options/trade_streaming.py"
270
+ ```
271
+
272
+ ```bash
273
+ > python trade_streaming.py
274
+ con:root: NVDA isOption: True exp: 2022-12-23 strike: 150.0 isCall: False
275
+ trade: ms_of_day: 35319636 sequence: 1297770003 size: 1 condition: 18 price: 2.29 exchange: ARCX date: 2022-12-23
276
+ con:root: NVDA isOption: True exp: 2022-12-23 strike: 145.0 isCall: False
277
+ trade: ms_of_day: 35319722 sequence: 1297772550 size: 1 condition: 18 price: 0.59 exchange: XBOS date: 2022-12-23
278
+ con:root: NVDA isOption: True exp: 2022-12-23 strike: 145.0 isCall: False
279
+ trade: ms_of_day: 35320534 sequence: 1297793907 size: 1 condition: 18 price: 0.59 exchange: XISX date: 2022-12-23
280
+ con:root: NVDA isOption: True exp: 2022-12-23 strike: 145.0 isCall: False
281
+ trade: ms_of_day: 35321269 sequence: 1297821400 size: 1 condition: 18 price: 0.6 exchange: ARCX date: 2022-12-23
282
+ con:root: NVDA isOption: True exp: 2022-12-23 strike: 145.0 isCall: False
283
+ trade: ms_of_day: 35321269 sequence: 1297821467 size: 1 condition: 18 price: 0.6 exchange: EDGX date: 2022-12-23
284
+ con:root: NVDA isOption: True exp: 2022-12-23 strike: 145.0 isCall: False
285
+ trade: ms_of_day: 35321269 sequence: 1297821468 size: 1 condition: 18 price: 0.6 exchange: BATS date: 2022-12-23
286
+ ```
287
+
288
+ ### Every Option Trade
289
+
290
+ Below requests to receive continuous updates for every option trade. This method is only
291
+ available to PRO subscribers.
292
+
293
+ === "trade_streaming_full.py"
294
+
295
+ ```python
296
+ --8<-- "docs/options/trade_streaming_full.py"
297
+ ```
298
+
299
+ ```bash
300
+ > python trade_streaming_full.py
301
+ con:root: SPXW isOption: True exp: 2023-01-06 strike: 3780.0 isCall: False
302
+ trade: ms_of_day: 40566197 sequence: 81076302 size: 4 condition: 4294967170 price: 35.15 exchange: XCBO date: 2022-12-23
303
+ con:root: CHWY isOption: True exp: 2023-01-20 strike: 42.5 isCall: False
304
+ trade: ms_of_day: 57375126 sequence: 3619080181 size: 1 condition: 4294967178 price: 4.55 exchange: XMIO date: 2022-12-23
305
+ con:root: TSLA isOption: True exp: 2022-12-23 strike: 132.0 isCall: True
306
+ trade: ms_of_day: 40566210 sequence: 796495932 size: 6 condition: 18 price: 0.15 exchange: XCBO date: 2022-12-23
307
+ con:root: TSLA isOption: True exp: 2022-12-23 strike: 132.0 isCall: True
308
+ trade: ms_of_day: 40566210 sequence: 796495933 size: 6 condition: 18 price: 0.15 exchange: XCBO date: 2022-12-23
309
+ con:root: SPY isOption: True exp: 2022-12-23 strike: 381.0 isCall: True
310
+ trade: ms_of_day: 41027015 sequence: 716643310 size: 6 condition: 125 price: 1.07 exchange: EDGX date: 2022-12-23
311
+ ```
312
+
239
313
## Historical NBBO Quotes
240
314
241
315
This tutorial will provide examples for requesting historical & intraday
0 commit comments