Data
The NautilusTrader platform provides a set of built-in data types specifically designed to represent a trading domain. These data types include:
OrderBookDelta
(L1/L2/L3): Represents the most granular order book updates.OrderBookDeltas
(L1/L2/L3): Batches multiple order book deltas for more efficient processing.OrderBookDepth10
: Aggregated order book snapshot (up to 10 levels per bid and ask side).QuoteTick
: Represents the best bid and ask prices along with their sizes at the top-of-book.TradeTick
: A single trade/match event between counterparties.Bar
: OHLCV (Open, High, Low, Close, Volume) bar/candle, aggregated using a specified aggregation method.InstrumentStatus
: An instrument-level status event.InstrumentClose
: The closing price of an instrument.
NautilusTrader is designed primarily to operate on granular order book data, providing the highest realism for execution simulations in backtesting. However, backtests can also be conducted on any of the supported market data types, depending on the desired simulation fidelity.
Order books
A high-performance order book implemented in Rust is available to maintain order book state based on provided data.
OrderBook
instances are maintained per instrument for both backtesting and live trading, with the following book types available:
L3_MBO
: Market by order (MBO) or L3 data, uses every order book event at every price level, keyed by order ID.L2_MBP
: Market by price (MBP) or L2 data, aggregates order book events by price level.L1_MBP
: Market by price (MBP) or L1 data, also known as best bid and offer (BBO), captures only top-level updates.
Top-of-book data, such as QuoteTick
, TradeTick
and Bar
, can also be used for backtesting, with markets operating on L1_MBP
book types.
Instruments
The following instrument definitions are available:
Betting
: Represents an instrument in a betting market.BinaryOption
: Represents a generic binary option instrument.Cfd
: Represents a Contract for Difference (CFD) instrument.Commodity
: Represents a commodity instrument in a spot/cash market.CryptoFuture
: Represents a deliverable futures contract instrument, with crypto assets as underlying and for settlement.CryptoPerpetual
: Represents a crypto perpetual futures contract instrument (a.k.a. perpetual swap).CurrencyPair
: Represents a generic currency pair instrument in a spot/cash market.Equity
: Represents a generic equity instrument.FuturesContract
: Represents a generic deliverable futures contract instrument.FuturesSpread
: Represents a generic deliverable futures spread instrument.Index
: Represents a generic index instrument.OptionContract
: Represents a generic option contract instrument.OptionSpread
: Represents a generic option spread instrument.Synthetic
: Represents a synthetic instrument with prices derived from component instruments using a formula.