ConceptsData
These docs track the unreleased nightly build and may change without notice. Switch to the latest stable docs.
TradeTick
TradeTick represents one executed trade or match event from a venue. It carries the traded price,
size, aggressor side, and venue trade identifier.
Fields
| Field | Rust type | Python type | Required/default | Notes |
|---|---|---|---|---|
instrument_id | InstrumentId | InstrumentId | Required | Instrument for the trade. |
price | Price | Price | Required | Executed price. |
size | Quantity | Quantity | Required | Executed quantity. |
aggressor_side | AggressorSide | AggressorSide | Required | Buyer, seller, or no aggressor. |
trade_id | TradeId | TradeId | Required | Venue‑assigned match ID. |
ts_event | UnixNanos | int | Required | Event timestamp in nanoseconds. |
ts_init | UnixNanos | int | Required | Initialization timestamp in nanoseconds. |
Behavior
sizemust be positive.- Information‑driven bars require
TradeTickdata because they useaggressor_side. - Trade bars use
LASTprice type. trade_idshould be stable for the venue event when the venue provides one.
Example
use nautilus_core::UnixNanos;
use nautilus_model::{
data::TradeTick,
enums::AggressorSide,
identifiers::{InstrumentId, TradeId},
types::{Price, Quantity},
};
let trade = TradeTick::new(
InstrumentId::from("BTCUSDT.BINANCE"),
Price::from("65000.10"),
Quantity::from("0.25"),
AggressorSide::Buyer,
TradeId::from("123456789"),
UnixNanos::from(1_000_000_000),
UnixNanos::from(1_000_000_100),
);Related guides
- Bar covers trade‑to‑bar aggregation.
- Information‑driven bars explains aggressor‑side use.
- Python API reference lists Python members.
QuoteTick
QuoteTick represents the top‑of‑book bid and ask for one instrument. It carries the best available bid and ask prices and sizes at a specific event time.
Bar
Bar represents OHLCV price and volume data for a specific BarType. A venue or data provider can supply bars, or NautilusTrader can aggregate them from quote...