nautilus_backtest/
lib.rs

1// -------------------------------------------------------------------------------------------------
2//  Copyright (C) 2015-2025 Posei Systems Pty Ltd. All rights reserved.
3//  https://poseitrader.io
4//
5//  Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
6//  You may not use this file except in compliance with the License.
7//  You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
8//
9//  Unless required by applicable law or agreed to in writing, software
10//  distributed under the License is distributed on an "AS IS" BASIS,
11//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//  See the License for the specific language governing permissions and
13//  limitations under the License.
14// -------------------------------------------------------------------------------------------------
15
16//! Backtest engine for [PoseiTrader](http://poseitrader.io).
17//!
18//! The *backtest* crate provides a comprehensive event-driven backtesting framework that allows
19//! quantitative traders to test and validate trading strategies on historical data with high
20//! fidelity market simulation. The system replicates real market conditions including:
21//!
22//! - Event-driven backtesting engine with simulated exchanges.
23//! - Market data replay with configurable latency and fill models.
24//! - Order matching engines with realistic execution simulation.
25//! - Multi-venue and multi-asset backtesting capabilities.
26//! - Comprehensive configuration and state management.
27//! - Integration with live trading systems for seamless deployment.
28//!
29//! # Platform
30//!
31//! [PoseiTrader](http://poseitrader.io) is an open-source, high-performance, production-grade
32//! algorithmic trading platform, providing quantitative traders with the ability to backtest
33//! portfolios of automated trading strategies on historical data with an event-driven engine,
34//! and also deploy those same strategies live, with no code changes.
35//!
36//! PoseiTrader's design, architecture, and implementation philosophy prioritizes software correctness and safety at the
37//! highest level, with the aim of supporting mission-critical, trading system backtesting and live deployment workloads.
38//!
39//! # Feature flags
40//!
41//! This crate provides feature flags to control source code inclusion during compilation,
42//! depending on the intended use case, i.e. whether to provide Python bindings
43//! for the [posei_trader](https://pypi.org/project/posei_trader) Python package,
44//! or as part of a Rust only build.
45//!
46//! - `ffi`: Enables the C foreign function interface (FFI) from [cbindgen](https://github.com/mozilla/cbindgen).
47//! - `python`: Enables Python bindings from [PyO3](https://pyo3.rs).
48
49#![warn(rustc::all)]
50#![deny(unsafe_code)]
51#![deny(nonstandard_style)]
52#![deny(missing_debug_implementations)]
53#![deny(clippy::missing_errors_doc)]
54#![deny(clippy::missing_panics_doc)]
55#![deny(rustdoc::broken_intra_doc_links)]
56
57pub mod accumulator;
58pub mod config;
59pub mod data_client;
60pub mod engine;
61pub mod exchange;
62pub mod execution_client;
63pub mod modules;
64
65#[cfg(feature = "ffi")]
66pub mod ffi;