Quant research and backtesting
Event-driven backtest
Also called event-based backtest, streaming backtest
A backtest that feeds market data to the strategy one event at a time, in timestamp order, and simulates order handling and fills as they would happen live.
How it works
The engine keeps a clock. Each new quote, trade or bar is an event that updates the strategy's state; the strategy may then send orders, which a simulated exchange fills under a fill model (queue position, partial fills, slippage, latency). Because the strategy can only read data up to the current timestamp, this design makes lookahead hard to commit by accident, and the same strategy code can often run live. The cost is speed: replaying tick data for thousands of instruments is slow, so it is used for final validation and for strategies whose results depend on execution detail, such as market making.
Worked example
A market-making strategy quotes at the best bid. In a vectorised test it is "filled" whenever the price touches its quote. An event-driven test with queue modelling fills it only after the volume ahead of it in the queue has traded, so many touches give no fill and the fills that do happen are biased towards moments when price moves through the quote, which is adverse selection.
Related terms
Put it to work in a timed game.
Practise with Find the BugSources
- quantconnect.com/docs/v2/writing-algorithms/key-concepts/algorithm-engi…
- nautilustrader.io/docs/latest/concepts/backtesting/
Last checked November 2026.