Skip to main content

Module engine

Module engine 

Source
Expand description

§Module: backtest::engine

Event-driven backtester with realistic fill simulation.

§Responsibility

Provides BacktestEngine which runs a list of Signals over a BacktestConfig containing OHLCV bars, simulating fills at the next-bar open with slippage and commission deductions.

§Guarantees

  • Fills execute at next-bar open (no look-ahead on the signal bar)
  • Slippage is expressed in basis points and applied symmetrically
  • Commission is deducted per fill as a fraction of notional
  • All equity curve values are non-negative

Structs§

BacktestEngine
Event-driven backtesting engine with realistic fill simulation.
BacktestMetrics
Summary performance metrics for a completed backtest.
BacktestResult
Full result of a BacktestEngine::run call.
CompletedTrade
A single closed round-trip trade.
EngineConfig
Configuration for a BacktestEngine run.
EngineSignal
A trading signal produced externally and fed into the engine.

Enums§

Direction
Direction of a trading signal.