Large Spread Gap in Real Time Data

Since no one is answering my question, I’d have to recreate the topic here:

I was playing around with the APIs and found the real time quote callback through StockDataStream:subscribe_quotes can give very different price data for some symbols than what’s pulled from StockHistoricalDataClient:get_stock_quotes. The StockDataStream contains greater spread data while the StockHistoricalDataClient is comparatively much closer to the real price. As an example, below is WYNN streaming vs. historical quotes for the same time period that you can see the difference from the highlights. Am I missing any filter or supposed to use specific exchange? Anyone has idea of how to get rid of the “noises”? Thanks!

Hi rock,

I’ve been investigating your issue - I think in the meantime, it’s best if you email support@alpaca.markets describing your issue.

I did but no one is responding. Yes PLEASE let me know what you find!

Hey :wave: You’re comparing the free IEX stream with the SIP data in historical.

Both StockDataStream and StockHistoricalDataClient has a feed argument. If you want quotes from all US exchanges, use the SIP value for the feed (this requires Unlimited Subscription for the stream and for the last 15 minutes in historical). If you want to get IEX quotes, use the IEX value. This means that only quotes from the IEX (v) exchange are included: you can see this in the ask_exchange and bid_exchange fields.

Probably your confusion comes from the fact, that the default value for the feed is IEX for the stream, but SIP for historical (if you don’t query the last 15 minutes).

@Gergely_Alpaca Thanks for clarifying. I assumed the DataFeed goes automatically with the type of API key with subscription. Would be good to mention it in the documentation so people may avoid asking similar questions.

@Gergely_Alpaca I was wondering, if SIP includes all exchanges, it’ll have exchange V as well, correct? If so, why wouldn’t SIP have exchange V’s large spread data as quoted from IEX?

@Gergely_Alpaca I was wondering, if SIP includes all exchanges, it’ll have exchange V as well, correct? If so, why wouldn’t SIP have exchange V’s large spread data as quoted from IEX?

Because the SIP feed displays the NBBO: National Best Bid & Offer, meaning the best bid and best ask across all exchanges. If the best bid / ask happens to be on IEX then yes, it’s included, but if isn’t, then no, that IEX offer is not in the SIP quote. The IEX feed on the other hand displays the BBO on the IEX exchange. Usually of course there are better offers on other exchanges, this is why the NBBO’s spread is smaller.

Makes sense. This is very valid info. to be mentioned in the doc. Thanks!