Spokes.wiki Search About
Defined Term concept updated Mon Jun 29 2026 00:00:00 GMT+0000 (Coordinated Universal Time)

Event-driven trading architecture

An event-driven trading system processes the market as a forward-only stream of events — each new bar, tick, or fill is an event the strategy reacts to in arrival order — rather than iterating over a pre-loaded table of data it can index freely. It is the architecture banbot is built around and the standard design for bias-safe backtesting.

Why event-driven

  • No lookahead by construction. Because the strategy only ever sees events up to “now,” it cannot read a future bar — the most common backtesting bug is structurally impossible. banbot makes this the explicit justification for its event loop.
  • Backtest/live symmetry. The same event interface feeds the strategy whether the events come from a historical file (backtest) or a live exchange feed (production), so one codebase runs both. This is why event-driven engines pair naturally with the one-codebase goal.
  • Flexibility. The strategy decides what to do on each event, leaving implementation free while the engine enforces correct time ordering. Banbot frames event-driven as prioritizing freedom while preventing lookahead.

The alternative it’s usually contrasted with

Catalogs of the field split backtest engines into event-driven and vector-based families awesome-systematic-trading. The vectorized kind computes over whole arrays of history at once, which is far faster for sweeping a strategy space but gives up the two properties above: the next bar is one array index away (lookahead becomes a silent bug rather than an impossibility), and a research-only array pass has to be rewritten to trade live. Event-driven buys fidelity and parity with speed.

Relation to RL

A reinforcement-learning trading loop is event-driven in spirit: the agent observes state, acts, and receives a reward step by step. tensortrade‘s exchange simulation + data-feed components play the role banbot’s event engine does — the difference is who decides, a learned policy versus hand-coded strategy logic.

backtesting · vectorized-backtesting · algorithmic-trading · reinforcement-learning-trading · banbot · awesome-systematic-trading · synthesis