Skip to main content

Crate nautilus_trading

Crate nautilus_trading 

Source
Expand description

Trading strategy machinery and orchestration NautilusTrader.

The nautilus-trading crate provides core trading capabilities including:

  • Forex sessions: Market session time calculations and timezone handling.

§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 (e.g. EmaCross) for backtesting and demos.
  • defi: Enables DeFi (Decentralized Finance) support.
  • high-precision: Enables high-precision mode to use 128-bit value types.
  • python: Enables Python bindings from PyO3.
  • extension-module: Builds the crate as a Python extension module.

Re-exports§

pub use algorithm::ExecutionAlgorithm;
pub use algorithm::ExecutionAlgorithmConfig;
pub use algorithm::ExecutionAlgorithmCore;
pub use algorithm::ImportableExecAlgorithmConfig;
pub use algorithm::TwapAlgorithm;
pub use algorithm::TwapAlgorithmConfig;
pub use strategy::ImportableStrategyConfig;
pub use strategy::Strategy;
pub use strategy::StrategyConfig;
pub use strategy::StrategyCore;

Modules§

algorithm
Execution algorithm infrastructure for order slicing and execution optimization.
examples
Example components for backtesting and demonstration.
python
Python bindings from PyO3.
sessions
Provides utilities for determining Forex session times. Includes functions to convert UTC times to session local times and retrieve the next or previous session start/end.
strategy

Macros§

nautilus_strategy
Implements Deref<Target = DataActorCore>, DerefMut, and Strategy for a strategy type.