Markets and Orders
An order specifies what a participant wants to buy or sell, how much, and any conditions on execution.
Bids and asks
The bid is a buying price; the ask is a selling price. The best bid is the highest available bid, and the best ask is the lowest available ask. Their difference is the spread.
An order book records outstanding orders. Depth is the quantity available at different prices. Liquidity describes how easily a quantity can be traded without moving the price substantially. See CME's liquidity guide.
Order types
A market order seeks immediate execution at available prices. Its final price can differ from the last trade or displayed quote.
A limit order sets a maximum buying price or minimum selling price. It may fill partly or not at all.
A stop order becomes a market order when its trigger condition is met. The trigger price is not a guaranteed execution price. See the SEC order guide.
Execution
An order large enough to use several price levels can have a worse average price than the best quote. This difference is part of execution cost, alongside fees and market impact.
See Market Making for how firms supply quotes.
Order lifetime
Time-in-force tells the venue how long an order remains active. A day order normally expires at the end of its trading session. Immediate-or-cancel executes what it can immediately and cancels the remainder. Fill-or-kill requires the whole quantity immediately or cancels it.
Names and supported behaviours vary by venue. A stop-limit order becomes a limit order when triggered, so it can remain unfilled even after the trigger is reached.
Queue position and fills
Price-time priority gives earlier orders priority at the same price. Other venues use different allocation rules. Changing an order may lose its queue priority, depending on the change and venue.
A displayed quote is not a promise that your order will reach it before another participant does. An order can fill partly, leaving the remainder active. A cancellation request can arrive after a fill.
Reading market data
A trade records an execution; a quote records an offer to trade. The last trade, midpoint and best bid are different prices. Timestamps may describe an exchange event, receipt by a data provider or receipt by your program.
Check for missing messages and session boundaries before reconstructing an order book. See Market Simulator for a small matching-engine design.