feat: Add deterministic replay backtesting engine and related documentation
CI / lint-test-build (push) Failing after 14s
CI / lint-test-build (push) Failing after 14s
This commit is contained in:
@@ -359,6 +359,25 @@ Profile scenarios:
|
||||
- `execution_spike`
|
||||
- `reconnect_storm`
|
||||
|
||||
## Backtesting
|
||||
|
||||
Run a deterministic replay backtest from a JSONL event stream:
|
||||
|
||||
```powershell
|
||||
python scripts/backtest_replay.py --events path\to\replay.jsonl --starting-balances USD=1000.0
|
||||
```
|
||||
|
||||
Replay event format:
|
||||
|
||||
```json
|
||||
{"timestamp":"2026-06-01T12:00:00Z","symbol":"BTC/USD","bids":[[100.0,1.0]],"asks":[[101.0,1.0]]}
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- Events are replayed in timestamp order.
|
||||
- The replay engine reuses the production detector, pre-trade validation, trade limits, and execution sequencer.
|
||||
- The simulated execution path applies configurable slippage and execution latency so reports include deterministic trade/miss statistics.
|
||||
Latency baseline and threshold artifacts:
|
||||
|
||||
- `ops/performance/latency_baseline.json`
|
||||
|
||||
Reference in New Issue
Block a user