QTQuant Terminal
B1-03B1·intro·~19 min

How prices actually form

marketsmicrostructureorder-bookbid-askorder-types

▸ Pretest — guess, even if you don't know

If a stock is 'quoted at $100,' which of these statements is most accurate?

The order book

When you watch a stock chart, you see a stream of "prices." Those are usually last trades — historical events. But at any instant, the current state of the market is an order book: a list of unfilled buy and sell orders.

A simplified order book for AAPL might look like this:

       SELL SIDE (asks)
       Size   Price
        500   $192.05
        300   $192.04
        100   $192.03   ← best ask
   ─────────────────────  spread = $0.02
        200   $192.01   ← best bid
        700   $192.00
       1100   $191.99
       SIZE   Price
        BUY SIDE (bids)

Two things to notice:

The "price" you see on a quote screen is usually the midpoint of the best bid and best ask. AAPL "at 192.02"meansbid=192.02" means bid=192.01, ask=$192.03.

Who provides the bid and ask?

Mostly market makers (recall them from B1-01). They post both a bid and an ask, slightly inside their estimate of fair value, hoping to earn the spread on round-trips. They lose when prices move sharply against their inventory.

Retail traders, hedge funds, institutional algos — all of them mostly take liquidity from this book. They pay the spread to market makers. The market makers' steady earnings come from being on both sides simultaneously.

This is the most important thing to internalize: most of the time, when you click "buy at market," you are paying the spread. The market maker is the immediate counterparty. They thank you for the spread, and they don't care which direction the stock goes next — they'll trade either way.

Order types — the four you must know

The exact menu of order types varies by venue and instrument, but four are universal:

Market order

"Buy/sell N shares at whatever price the market gives me, right now."

Limit order

"Buy at 192.01orbetter,sellat192.01 or better, sell at 192.03 or better."

Stop order (stop-loss)

"If price falls to $190.00, place a market order to sell."

Stop-limit

"If price falls to 190.00,placealimitsellorderat190.00, place a *limit* sell order at 189.50."

There are many more (Iceberg, IOC, FOK, post-only, hidden, midpoint-peg, ...), but these four cover ≥90% of what we'll discuss.

Why this matters for backtests

When you backtest a strategy, you have a price series — usually daily closes, sometimes minute bars. The question that destroys most retail backtests is: what price would I have actually filled at?

A naive backtest on close prices that shows 8% annual returns frequently shows 0% or negative once realistic spreads and slippage are modeled. We'll come back to this when we cover backtesting methodology (Track D4).

⧉ Review card
What is the bid-ask spread?
The difference between the best price a buyer will pay (bid) and the best price a seller will accept (ask). Crossing it is a cost paid by liquidity takers, earned by market makers.
⧉ Review card
Why is the 'quoted price' not really one number?
It's typically the midpoint of bid and ask. You can't actually trade at the midpoint — you buy at the ask, sell at the bid.
⧉ Review card
What's the difference between a market order and a limit order?
Market: guaranteed fill, zero price control. Limit: price control, no fill guarantee. Pros default to limits.
⧉ Review card
What goes wrong with a stop order in a gap-down?
The stop triggers a market order at the gap price — you can fill far below your stop level. Stop-limits avoid this but can fail to fill entirely.
⧉ Review card
Why do most retail backtests overstate returns?
They assume fills at quoted prices (often the close), ignoring the bid-ask spread and slippage. Honest cost modeling often cuts headline Sharpe in half or worse.

Predict before the next lesson

Tomorrow we'll trace a single trade from "click buy" to "shares in your account." Before then, predict:

Write your guesses. Tomorrow we'll see how close they are.

◈ Calibration check

How comfortable are you with the order book, spread, and the four order types?

1 = guessing · 5 = could teach it

⏻ End of lesson

Mark it read to book its 5 review cards into your deck.

Sources & further reading