nautilus_trader

raw JSON →
1.226.0 verified Fri May 01 auth: no python

Production-grade, Rust-native algorithmic trading engine with a deterministic event-driven architecture. Current version: 1.226.0 (Beta, released 2026-04-29). Requires Python >=3.12,<3.15. Active development with frequent releases (roughly every 2-4 weeks).

pip install nautilus_trader
error ModuleNotFoundError: No module named 'nautilus_trader'
cause Package not installed or installed in the wrong environment.
fix
Run 'pip install nautilus_trader' in the correct Python environment (3.12+).
error ImportError: cannot import name 'BacktestEngine' from 'nautilus_trader.backtest'
cause Incorrect import path; BacktestEngine is in backtest.engine.
fix
Use 'from nautilus_trader.backtest.engine import BacktestEngine'.
error AttributeError: module 'nautilus_trader' has no attribute 'live'
cause Old version or incorrect import; live engine is a separate subpackage.
fix
Make sure you have installed the correct version (>=1.214.0?) and use 'from nautilus_trader.live.node import TradingNode'.
error RuntimeError: Rust backend failed to initialize: Could not find nautilus_trader Rust binary
cause Missing Rust library or broken installation.
fix
Reinstall with 'pip install --force-reinstall nautilus_trader'. If on a non-standard platform, compile from source with Rust toolchain.
error ValueError: Unrecognized instrument class: InstrumentGeneric
cause Using an obsolete instrument class that was removed in a recent version.
fix
Use a concrete instrument class (e.g., Instrument, FuturesInstrument, OptionsInstrument) or update your code to match current API.
gotcha Python 3.11 support dropped in v1.221.0 (final release with Python 3.11 was v1.221.0). Use Python >=3.12.
fix Upgrade to Python 3.12, 3.13, or 3.14 (note: dYdX and IB adapters may not support 3.14 yet).
gotcha dYdX adapter (extra [dydx]) not available on Python 3.14 due to upstream coincurve incompatibility.
fix Use Python 3.12 or 3.13 if you need dYdX adapter.
gotcha Interactive Brokers adapter (extra [ib]) not available on Python 3.14 due to upstream nautilus-ibapi incompatibility.
fix Use Python 3.12 or 3.13 if you need IB adapter.
breaking The base class for strategies moved from nautilus_trader.strategy to nautilus_trader.model.strategy in v1.220+. Old imports will break.
fix Update imports to 'from nautilus_trader.model.strategy import Strategy'.
gotcha nautilus_trader uses Rust under the hood. pip install may build native code and require Rust toolchain (rustc, cargo) on some platforms.
fix Install Rust from rustup.rs, or use pre-built wheels if available for your platform.
deprecated Python 3.11 support ended with v1.221.0.
fix Upgrade Python to >=3.12.
pip install nautilus_trader[betfair]
pip install nautilus_trader[ib]
pip install nautilus_trader[dydx]

Minimal backtest engine setup. Full example requires data and strategy.

from nautilus_trader.backtest.engine import BacktestEngine
from nautilus_trader.model.data import Bar, BarType, BarSpecification
from nautilus_trader.model.enums import PriceType, AggregationSource
from nautilus_trader.model.identifiers import InstrumentId, Venue, Symbol
from nautilus_trader.model.instruments import Instrument
from nautilus_trader.core.datetime import secs_to_nanos
import pandas as pd

# Create a simple backtest engine
engine = BacktestEngine()

# Create an instrument
instrument_id = InstrumentId(Symbol('ETH/USD'), Venue('BINANCE'))

# (Simplified: real usage involves adding strategies, data, and running)
engine.add_instrument(instrument_id)
print('Backtest engine created successfully.')