How prices actually form
▸ 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 — records of deals that already happened. The current state of the market at any instant is the order book — the exchange's live list of every buy and sell order that hasn't traded yet. Waiting buy orders are called bids; waiting sell orders are called asks.
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 best bid is always below the best ask. The best bid is the highest price any buyer is currently offering. The best ask is the lowest price any seller will accept. If they ever overlapped, those orders would instantly match and trade away. So whenever the book is at rest, there's a gap between them — the bid-ask spread. In the book above, it's two cents.
- There's depth. Behind the best bid and ask sit more orders at slightly worse prices. If you want to trade a large quantity, your order eats through those levels one by one — buying at ever-higher prices, or selling at ever-lower ones.
The "price" you see on a quote screen is usually the midpoint — halfway between the best bid and best ask. AAPL "at 192.01, ask=$192.03. Note you can't actually trade at that midpoint number.
Who provides the bid and ask?
Mostly market makers — firms whose whole business is continuously posting both a bid and an ask (recall them from B1-01). They place both quotes a little on either side of what they estimate the stock is really worth. The plan: buy at the bid, sell at the ask, and pocket the spread on each round-trip — one buy plus one matching sell. They lose when the price moves sharply while they're holding inventory — shares they've bought but not yet offloaded.
The resting orders in the book are the market's liquidity — how easily you can buy or sell without moving the price. Retail traders, hedge funds, and institutional algorithms mostly take that liquidity: they trade against the resting orders rather than posting their own. Takers 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 — the one on the other side of your trade. 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."
- Pro: guaranteed to fill — a fill is your order actually executing — as long as any liquidity exists.
- Con: zero price control. In thin markets — books with few resting orders — you can pay much worse than the quoted price. Filling worse than the quote is called slippage.
- When to use: never, unless the spread is tight and the order is small. Pros use limits.
Limit order
"Buy at 192.03 or better."
- Pro: price control. You won't pay more than your limit.
- Con: no fill guarantee. The market might move away and never come back.
- When to use: most of the time. Limit orders are the workhorse.
Stop order (stop-loss)
"If price falls to $190.00, place a market order to sell."
- Pro: automated risk control. Caps the downside on a position.
- Con: the stop triggers when a trade at your stop price appears on the tape — the public feed of executed trades. It then fills like any market order, at whatever price is available. In a gap-down — the price jumping straight down, skipping levels with no trades in between, common at the open after bad overnight news — you can fill far below your stop level.
- When to use: for risk control on individual positions. Many systematic strategies use them.
Stop-limit
"If price falls to 189.50."
- Pro: price floor on the fill.
- Con: might not fill at all if the price gaps past your limit — jumps over it without ever trading there.
- When to use: for traders who'd rather hold the position than fill at a bad price.
There are many more (Iceberg, IOC, FOK, post-only, hidden, midpoint-peg, ... — names you can look up if you ever need them), but these four cover ≥90% of what we'll discuss.
Why this matters for backtests
A backtest is a simulation of a trading strategy on historical data, to estimate how it would have done. When you backtest, you have a price series — usually daily closes (the last traded price of each day), sometimes minute bars (one summary row per minute of trading). The question that destroys most retail backtests is: what price would I have actually filled at?
- If you used the day's close, you've assumed perfect execution at end of day. In reality you'd pay the spread.
- If you used the open, you might be assuming a fill before the market has even settled.
- Minute bars hide intra-minute spread variation.
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 cardWhat is the bid-ask spread?
⧉ Review cardWhy is the 'quoted price' not really one number?
⧉ Review cardWhat's the difference between a market order and a limit order?
⧉ Review cardWhat goes wrong with a stop order in a gap-down?
⧉ Review cardWhy do most retail backtests overstate returns?
Predict before the next lesson
Tomorrow we'll trace a single trade from "click buy" to "shares in your account." Before then, predict:
- When you click "buy" on a broker app and your order fills 200 milliseconds later, how many intermediaries has your order touched in that time? (1? 3? 10?)
- Who actually holds your shares when you own a stock? You? Your broker? Someone else?
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
- bookHarris (2003), Trading and Exchanges — §5, 6, 7
- bookO'Hara (1995), Market Microstructure Theory — §1, 2
- webRobert Almgren, lecture notes on market microstructure (NYU) link