Files
jgrusewski 672c873571 cleanup: declarative rewrites for deferred-work TODOs across ml crates
- ml-dqn/dqn.rs: `apply_accumulated_gradients` is a scaffolding method
  whose real optimizer step lives in the fused CUDA trainer. The
  `grads` map was already being dropped silently; reword the comment
  to describe that split explicitly (incidental: see trainer path for
  the live gradient application).
- ml-features/mbp10_loader.rs: strip the "TODO optimize with binary
  search" parenthetical from the docstring. Linear search over the
  sorted snapshot slice is the intended behaviour for current call
  sites.
- ml-hyperopt/optimizer.rs: `optimize_two_phase` short-circuits after
  Phase A because `DQNTrainer` is not `Clone`. Describe that limit
  and point callers at `optimize_parallel` (which requires `M: Clone`)
  rather than a hypothetical Phase B.
- ml-checkpoint/signer.rs: `fetch_key_from_vault` is currently an
  env-var resolver. Reword to say so plainly — no Vault client is
  wired into this crate, production uses K8s secrets injected as env.
- backtesting/dbn_replay.rs: `DbnReplayEngine::from_bytes` remains an
  Err stub because `DbnParser` is gated behind the `databento`
  feature which this crate does not enable. Replace the pseudocode
  block with a declarative comment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 08:35:27 +02:00
..

backtesting

Strategy backtesting engine for simulating trading strategies against historical market data.

Key Types

  • Backtester — main backtesting engine
  • BacktestConfig — simulation configuration (time range, instruments, slippage, commissions)
  • BacktestResults — performance metrics (Sharpe, max drawdown, alpha, beta, Sortino)

Features

  • Historical data replay from Parquet files (ticks, order book snapshots, candles)
  • Configurable slippage models (fixed, percentage, volume-based)
  • Commission modeling (fixed, percentage, per-contract)
  • Pluggable strategy interface

Usage

use backtesting::{Backtester, BacktestConfig};
let config = BacktestConfig { /* ... */ };
let results = backtester.run(&strategy)?;