qs-backtest — Backtesting engine for the quant-system workspace.
This crate provides tools for replaying historical market data through the
[qs_core::TradeEngine] to evaluate trading strategies and predefined
signal sets.
Two modes of operation
- Strategy-driven — implement the [
Strategy] trait; the runner feeds market data tick-by-tick and your strategy decides when to act. - Signal replay — provide a
Vec<Signal>with timestamps; the runner injects them at the correct moments while replaying price data.
Key types
| Type | Purpose |
|---|---|
[BacktestRunner] |
Orchestrates the backtest loop (both modes) |
[BacktestExecutor] |
Tracks simulated fills, positions, and P&L |
[BacktestResult] |
Final report — P&L, win rate, drawdown, trade log |
[DataFeed] |
Trait for sequential market event sources |
[Strategy] |
Trait for strategy-driven backtests |