An event-driven backtest processes a time-ordered stream of events (market data, order acknowledgements, fills, cancellations, corporate actions) one at a time, each changing the state of the strategy, its orders and its portfolio. Its simulated clock is the time of the event being processed; nothing may use information stamped later.
firm.evbt: one queue of events ordered by time, kind and sequence number, a dispatcher, and handlers that may only schedule events in the future.