feat: Add deterministic replay backtesting engine and related documentation
CI / lint-test-build (push) Failing after 14s

This commit is contained in:
2026-06-01 14:57:42 +02:00
parent cc11082ea7
commit 7c86e838fa
6 changed files with 540 additions and 0 deletions
+19
View File
@@ -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`