Day 281 — Rebuilding a book from the messages that built it
Friday, 14 May 2027 · Week 41 of 52 · Microstructure · Study day · 60 min
Every backtest you have run assumed a price existed; today you construct one from the individual orders that produced it, and the exercise permanently changes what a quote looks like to you.
What you should be able to do tonight
- Parse an ITCH sample and reconstruct the top of book for one symbol through a full session.
- Report the number of messages per second and the fraction that are cancellations.
Tasks 60 min
40 min Write a parser for the ITCH message types you need: add order, order executed, order cancel, order delete and order replace. Ignore the rest. Feed them into your day 9 toy matching book, which was built for exactly this and has been waiting since week 2.
20 min Report three numbers for one liquid symbol: messages per second at the busiest minute, the fraction of orders that are cancelled before executing, and the median lifetime of an order that gets cancelled. The cancellation fraction is the number that surprises people and it is usually well above 90 percent.
Resources
Deliverable
notebooks/day-281-itch.ipynb with a reconstructed top of book for one symbol and three message statistics reported.
Checkpoint
What fraction of orders in your sample were cancelled before trading, and what does that tell you about what a quote represents?
Prepare for tomorrow
Ten minutes tonight so Day 282, Saturday, 15 May 2027 starts clean. This is what the evening email sends you.
From your reconstructed book, snapshot the ten levels on each side once per second through the session.
Plot the total depth within 10 basis points of the mid over the day.
Note the shape around the open and the close.