Expand description
Backtest engine for NautilusTrader.
The nautilus-backtest crate provides an event-driven backtesting framework that allows
quantitative traders to test and validate trading strategies on historical data with high
fidelity market simulation. The system replicates real market conditions including:
- Event-driven backtesting engine with simulated exchanges.
- Market data replay with configurable latency and fill models.
- Order matching engines with realistic execution simulation.
- Multi-venue and multi-asset backtesting capabilities.
- Configuration and state management.
- Integration with live trading systems for direct deployment.
§NautilusTrader
NautilusTrader is an open-source, production-grade, Rust-native engine for multi-asset, multi-venue trading systems.
The system spans research, deterministic simulation, and live execution within a single event-driven architecture, providing research-to-live semantic parity.
§Feature Flags
This crate provides feature flags to control source code inclusion during compilation, depending on the intended use case, i.e. whether to provide Python bindings for the nautilus_trader Python package, or as part of a Rust only build.
examples: Enables example strategies and the EMA crossover backtest example.streaming: Enablespersistencedependency for streaming configuration.ffi: Enables the C foreign function interface (FFI) from cbindgen.python: Enables Python bindings from PyO3.extension-module: Builds the crate as a Python extension module.
Modules§
- accumulator
- Time event accumulation and scheduling for the backtest engine.
- config
- Configuration types for the backtest engine, venues, data, and run parameters.
- data_
client - Provides a
BacktestDataClientimplementation for backtesting. - data_
iterator - Multi-stream, time-ordered data iterator for replaying historical market data.
- engine
- The core
BacktestEnginefor backtesting on historical data. - exchange
- Provides a
SimulatedExchangevenue for backtesting on historical data. - execution_
client - Provides a
BacktestExecutionClientimplementation for backtesting. - ffi
- C foreign function interface (FFI) from cbindgen.
- modules
- Simulation module trait for extending backtesting with custom venue behaviors.
- node
- Provides a
BacktestNodethat orchestrates catalog-driven backtests. - python
- Python bindings from PyO3.
- result
- Results from completed backtest runs.