@nthorwir Welcome to the confounding catalog of trade conditions. First, I assume what’s being referred to are ‘trades’ and not ‘quotes’ . The question starts with ‘quotes’ but then goes on to describe ‘trades’. I’ll assume we are talking about trades, but do correct me if that’s not a good assumption.
a) I often see the Q condition on several quotes from the same exchange (often) ‘N’. With same volume and price. I assume these are duplicates that should be ignored and not be aggregated to total volume.
The Q condition is a “Market Center Official Open” entry. It’s not a real trade per se. It should be excluded from both volume and price numbers. It indicates the ‘Official’ opening value of a particular exchange or market center. However, how it’s determined is completely up to each market center.
b) Also often see Q from different exchanges with different prices, but N typically has the highest vol. I guess I should use that or weight adjusted average ?
Again, typically exclude Q trades from any calculations.
c) I have seen Q and O trades. What is the difference?
A Q trade as mentioned above is a “Market Center Official Open” and can really be anything a specific exchange/center defines it as.
An O trade is an “Opening Print”. The term ‘print’ goes way back to when there were ticker-tape machines. Every executed trade on the tape is called a print. Therefore, the “opening prints” are the first, or opening, trades of the day.
The first trade executed on each market center (there are over 22 exchanges alone) could result in a separate O trade each one at a different time and a different price.
Is one of them expected to be closer to the typically reported Open price?
It’s important to note there is no standardized single authority for open prints. Not all market centers report O trades and may simply start the day reporting trades with no particular designation. To complicate things, market centers may report O trades for some stocks and not others.
The generally accepted guidance on which trades to include and exclude for price and volume comes from the two SIPs. Here are links to their tech docs UTP and CTS. Right off the confusion starts because, while they give guidance on the ‘last’ or ‘close’ prices, they do not give guidance on the consolidated market open prices.
So, most data providers, including Alpaca, report the ‘Open’ as simply the first trade of the day, across all trading centers, which has trade conditions which would include it as a ‘Close’ trade. The ‘Open’ is simply the very first ‘valid’ trade of the day.
Sounds simple. A problem arrises however because of Market On Open (MOO) orders. MOO orders participate in a special auction on one or more exchanges which typically start exactly at market open. The issue is those auctions take a physical amount of time to complete. Often many seconds and conceivably minutes. By the time those trades are reported, there may have been other ‘normal’ non-MOO trades executed. These other trades become the ‘Open’ simply because they occurred first. However, one is rather expecting the ‘Open’ price to be the MOO price. It typically is, but there are no guarantees. Compounding this problem is several exchanges can have opening auctions for the same stock resulting in several MOO prices.
Personally, I would just fetch the daily Open bar price of the day and not look at trades. There may be a few inconsistencies if the trade was a MOO or simply the first trade, but in the big picture it generally washes out.