Day 9 — Price-time priority, and what happens to your order

Saturday, 15 August 2026 · Week 2 of 52 · Markets · Study day · 60 min

Queue position is the single most valuable thing a passive order owns, and understanding why is what stops you from writing a backtest that fills at the touch every time.

What you should be able to do tonight

  • Trace a marketable buy order through a book with three price levels and say exactly which resting orders it trades against and in what order.
  • Explain why two orders at the same price are not worth the same, and what that is worth in a tick.

Tasks 60 min

30 min Watch lecture 3 of the Copenhagen microstructure playlist, on the matching mechanism and priority rules, with the slides open.

30 min Build a toy matching engine in a notebook: a dict of price levels holding a deque of (order_id, size) per level, plus add_limit, cancel and execute_market functions honouring price then time. Fifty lines. You will reuse it in week 41.

Resources

Deliverable

notebooks/day-009-matching.ipynb with a working price-time-priority book that correctly walks a 10,000-share market order through three levels.

Checkpoint

Two orders sit at 20.00, yours behind another for 5,000 shares. What has to happen before you trade, and name two ways you never do?

Prepare for tomorrow

Ten minutes tonight so Day 10, Sunday, 16 August 2026 starts clean. This is what the evening email sends you.

Pull one-minute bars for SPY for the last five trading days from any source you have, and look at the volume in the last minute against the rest of the day.

Read the one-paragraph description of the Nasdaq closing cross on Nasdaq’s own site.

Open the Optiver Trading at the Close Kaggle competition page and read the data description only. You will use this dataset in phase 7; today it is context.