Day 297 — TWAP, VWAP and participation, and what each one is for

Sunday, 30 May 2027 · Week 43 of 52 · Microstructure · Study day · 60 min

Three algorithms that cover most institutional execution, each optimal against a different benchmark, and the choice of benchmark is a choice about who is being blamed for the outcome.

What you should be able to do tonight

  • Say what benchmark each algorithm minimises deviation from, and when each is the right one.
  • Implement all three and compare their realised cost on your own data.

Tasks 60 min

35 min Implement the three in qlib/exec/: TWAP on a clock, VWAP on a forecast volume profile, and a participation-rate algorithm that trades a fixed fraction of observed volume. The middle one needs an intraday volume forecast, which you can build as a simple average profile by time of day from your ITCH sample.

25 min Compare them on the same orders: simulate each against your reconstructed book for a set of order sizes, and report realised cost against arrival price and against the day’s VWAP. An algorithm that beats VWAP and loses against arrival is doing exactly what it was designed to do, and that is the point of the comparison.

Resources

Deliverable

Three execution algorithms in qlib/exec/ compared on realised cost against two benchmarks.

Checkpoint

Your algorithm beat VWAP and lost against arrival price. Is that good? Say what each benchmark measures.

Prepare for tomorrow

Ten minutes tonight so Day 298, Monday, 31 May 2027 starts clean. This is what the evening email sends you.

Write down every component of the difference between the price you decided to trade at and the price you achieved.

There are at least four, and one of them is the trade you did not manage to do.

Four lines.