Execution & trading costs

Order book

Order book is a record of currently available buy and sell orders for a security, organized by price and quantity, that shows displayed liquidity at a particular venue or across specified venues.

What it means

An order book displays outstanding buy orders, called bids, and sell orders, called asks, for a security. Each price level has a displayed quantity. The highest bid is the best bid; the lowest ask is the best ask. Their difference is the quoted bid-ask spread.

A book may show one exchange's orders or a view assembled from multiple venues. It is a changing snapshot, not a complete record of everyone willing to trade. Hidden orders, orders at other venues, and orders not yet submitted may be absent. Displayed orders can also be canceled or replaced before another order reaches them.

How it is calculated

An order book itself is not calculated from a single formula: it is assembled from outstanding orders. One useful calculation is the displayed depth available to a buy order up to a chosen price:

Displayed ask depth through price P (shares) = sum of displayed ask quantities (shares) at ask prices ≤ P

Here, P is the maximum price in US$ per share being examined. Each ask price is a sell-order price in US$ per share, and each displayed ask quantity is the number of shares shown at that price. The sum is measured in shares. For a sell order, the analogous bid depth sums displayed bid quantities at prices at or above a chosen minimum price.

Depth depends on the price range selected. A large quantity several price levels away is not available at the best quoted price. Neither displayed depth nor a quoted spread guarantees an execution price or quantity.

Worked example

Suppose a hypothetical US stock has this displayed book at one venue. All figures are illustrative; quantities shown are shares.

Bid price Bid quantity Ask price Ask quantity
US$19.99 300 US$20.00 200
US$19.98 500 US$20.02 400
US$19.97 700 US$20.05 600
  1. The best bid is US$19.99, and the best ask is US$20.00. The quoted spread is US$20.00 − US$19.99 = US$0.01 per share.
  2. Displayed ask depth through US$20.02 is 200 + 400 = 600 shares.
  3. If a hypothetical 500-share market buy order encountered exactly these available asks and no other changes or execution rules intervened, 200 shares would fill at US$20.00 and 300 at US$20.02. Its volume-weighted average fill price would be (200 × US$20.00 + 300 × US$20.02) / 500 = US$20.012 per share, or US$10,006 in total before other costs.

The conditional result is arithmetic, not a fill prediction: the book may change before or during execution, and routing may involve other venues.

Why it matters before you trade

The book distinguishes price from available size. An order larger than the quantity displayed at the best quote may reach additional price levels, producing a different average fill price. The displayed spread is therefore only part of a potential execution cost.

A pre-trade check can compare order size with available liquidity and consider how quickly an order might be executed. Thin displayed depth can matter especially when a stock is volatile or trading is disrupted. But a snapshot cannot establish future liquidity: new orders may arrive, existing ones may disappear, and some liquidity is not displayed.

Market and limit orders interact with the book differently. A market order seeks available opposite-side liquidity without specifying a price limit; a limit order specifies the worst acceptable price but may fill only partly or not at all. These are execution mechanics, not instructions to use either order type.

How PreTrAIde uses it

PreTrAIde's product facts do not say that it ingests live order-book data or measures displayed depth at individual price levels. Its pre-trade analysis instead estimates execution-related conditions using market data, including end-of-day prices and volumes. Its quantitative layer estimates the bid-ask spread, participation in daily volume and market impact, and produces liquidity and execution scores.

For a user-built stock basket, PreTrAIde returns basket-level and line-level GO, NO-GO or MODIFY verdicts with reasoning and a suggested execution strategy. Those verdicts are decision support, not recommendations or guarantees of a fill. PreTrAIde does not place orders; users trade through their own broker.

Common mistakes

  • Treating displayed depth as all available liquidity. Hidden orders and other venues may not appear in the view.
  • Assuming a snapshot will persist. Orders can be added, changed, canceled or executed rapidly.
  • Confusing the best quote with the price for an entire order. The quantity at that quote may cover only part of the order.
  • Adding both sides together to estimate executable size. A buy interacts with asks; a sell interacts with bids.
  • Treating an estimate based on daily volume as a live book reading. They describe different aspects of liquidity.

Frequently asked questions

What is the difference between an order book and Level 2 quotes?

An order book is the set of outstanding orders represented in a market's trading system. Level 2 quotes are a displayed view of price levels and sizes; what that view includes depends on its venue coverage and data feed.

Does an order book show every order for a stock?

No. A particular view may omit other venues and hidden orders, and it cannot show orders that have not been submitted. Displayed quantities may change before execution.

Can you calculate a guaranteed fill price from an order book?

No. You can calculate a hypothetical average price using currently displayed quantities, but cancellations, new orders, routing and other changes can alter the actual fill.

Related terms

Execution & trading costs

Pre-trade analysis Post-trade analysis Transaction cost analysis (TCA) Effective spread Realized spread Midpoint price Slippage Market impact All glossary terms →

Check your next trade before you place it

Build a basket, run a pre-trade analysis, and get a GO, NO-GO or MODIFY verdict with the cost, liquidity and risk behind it.

Start your free trial Try the free tools

Educational content, not investment advice. PreTrAIde is analysis software, not a broker: it never executes orders, and its verdicts are decision support, not recommendations to buy or sell.