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 — 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 bid is always less than the ask. If they ever crossed, the orders would instantly match and trade. So at any equilibrium, there's a gap — the bid-ask spread.
- There's depth. Behind the best bid and ask are more orders at slightly worse prices. If you want to trade size, you walk into that depth (and pay more, or sell for less).
The "price" you see on a quote screen is usually the midpoint of the best bid and best ask. AAPL "at 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."
- Pro: guaranteed to fill (assuming any liquidity exists).
- Con: zero price control. In thin markets, you can pay much worse than the quoted price (this 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: stops trigger on the trade tape, not necessarily fill at the stop price. In a gap-down, you can fill far below.
- 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.
- 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, ...), 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?
- 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