Day 141 — Vectorized and event-driven lie about different things

Friday, 25 December 2026 · Week 21 of 52 · The research harness · Study day · 65 min

Every backtest you have run this year computes positions as an array operation, which is fast and which quietly assumes several things you listed last night.

What you should be able to do tonight

  • Name three things a vectorised backtest cannot represent and one thing it gets right that an event-driven engine often gets wrong.
  • Give two reasons the two architectures legitimately disagree and one that means you have a bug.

Tasks 65 min

25 min Write the comparison out: a vectorised backtest cannot represent partial fills, order rejection, intraday sequencing, position-dependent sizing, or a stop that triggers within a bar. An event-driven engine represents all of those and is slower by two orders of magnitude, which changes what research you can afford to do.

30 min Read the source of a small event-driven engine, backtesting.py, specifically its main loop and its order handling. It is a few hundred readable lines and reading it is faster than reading the documentation.

10 min Decide and record the architecture you will build: an event loop over sessions rather than over ticks, which keeps the sequencing honest without paying for intraday simulation you have no data for.

Resources

Deliverable

A written architecture decision in reports/milestone-05-platform.md with the three things vectorisation cannot represent.

Checkpoint

Vectorized and event-driven backtests disagree on the same strategy. Give two reasons that is expected and one that means you have a bug.

Prepare for tomorrow

Ten minutes tonight so Day 142, Saturday, 26 December 2026 starts clean. This is what the evening email sends you.

Sketch the event loop on paper: what events exist, in what order they fire within a session, and what state each one may read.

The ordering of signal computation, order generation and fill is the part that decides correctness.

Three boxes and some arrows is enough.