Understanding quote data

Now that I’m able to get quote data, I’m just trying to make sure I understand it… I’m using AAPL as an example, and it often has zero for both the bid size and ask size, e.g.:

'ask_exchange': 'V',
'ask_price': 0.0,
'ask_size': 0.0,
'bid_exchange': 'V',
'bid_price': 0.0,
'bid_size': 0.0,
'conditions': ['R'],
'symbol': 'AAPL',
'tape': 'C',
'timestamp': datetime.datetime(2023, 11, 1, 12, 59, 7, 100141, tzinfo=TzInfo(UTC))

But I expected there to always be a “best” bid or ask at any given time, because as soon as any volume is taken, there are plenty of worse bids or asks behind it to become the new best ones. How am I misunderstanding this? Is it different to what would be called “level 1 market data”?

@pw12345 The quotes are the most recent ‘best’ bid and/or ask as of the timestamp. Quotes are ‘reset’ at the beginning of each day and, if there are no bids or asks (essentially limit buy and sell orders respectively), then a 0 is returned for the price and size. Ideally, the response would be none or na but they are numeric fields so they show 0. It’s not uncommon to see 0’s before the markets open when orders are very sporadic. A 0 essentially means ‘no quote yet today’.

Notice the exchange attribute is V. That is the code for the IEX exchange. The feed may have been specified as feed=iex? Typically, for either the free or paid data plans, the default will be full market data with quotes from all exchanges and venues and not just the IEX exchange. By specifying feed=iex only orders placed on the IEX exchange show up as quotes, and a subtle point, they are only the latest best quote on the IEX exchange and not necessarily the best full market (NBBO) quote. Unless one is testing or debugging or wants an ‘estimate’ of recent real time quotes, do not specify IEX.

One can generally expect there always to be a quote (ie non-zero price and size) during market hours when fetching full market data. Part of that is because of the volume of orders, but also because market makers are required to ‘make a market’ for the symbols they track and always have a bid and ask submitted during market ours.

During the pre-market session and/or if specifying feed=iex there can be a lot of 0 price and size quotes.

Does that help?

Hi Dan, that’s really helpful thanks :slightly_smiling_face: You’re right it is specified as IEX. I’ll try with full market data.