Overview
Runs trading strategies against historical market data using the shared Strategy Interface. Produces backtest results and performance reports.
Documents
Backtesting Engine
Responsibilities
Runs trading strategies against historical market data offline, without publishing to the live EventBus.
- Accepts a sequence of historical MarketTick objects (from CsvReplayAdapter or SimulatedMarketDataAdapter)
- Runs all registered IStrategy implementations via
StrategyEngine.run_backtest(ticks) - Collects Signal results without side effects on the live system
- Produces a backtest report: signals generated, P&L simulation, strategy performance metrics
Design Notes
- Reuses the same IStrategy protocol as the live Strategy Engine — strategies are portable
- No EventBus publishing in backtest mode — safe for offline analysis
- Supports both simulated and CSV-replay data sources
- Milestone 1: basic signal collection; P&L simulation planned for Milestone 2
Event Flow
Historical ticks → BacktestingEngine → StrategyEngine.run_backtest() → [Signal, ...]