Back to Nautilus Trader

Equity

docs/concepts/instruments/equity.md

1.228.04.8 KB
Original Source

Equity

Equity represents a listed share, ETF, or similar cash-market security. Nautilus uses this type for instruments that trade in whole units, quote in one currency, and have no contract expiry.

Examples include AAPL.XNAS, MSFT.XNAS, and venue-specific ETF symbols.

Fields

FieldRust typePython typeRequired/defaultNotes
instrument_idInstrumentIdInstrumentIdRequiredStored as id in Rust.
raw_symbolSymbolSymbolRequiredNative venue symbol.
currencyCurrencyCurrencyRequiredQuote and settlement currency.
price_precisionu8intRequiredDecimal places allowed for prices.
price_incrementPricePriceRequiredSmallest valid price step.
lot_sizeOption<Quantity>QuantityRequired/PythonBoard lot or whole‑share lot size.
ts_eventUnixNanosintRequiredEvent timestamp in nanoseconds.
ts_initUnixNanosintRequiredInitialization timestamp in nanoseconds.
isinOption<Ustr>str | NoneNoneInternational Securities ID when known.
max_quantityOption<Quantity>Quantity | NoneNoneMaximum order quantity.
min_quantityOption<Quantity>Quantity | NoneNoneMinimum order quantity.
max_priceOption<Price>N/ARust onlyMaximum valid quote or order price.
min_priceOption<Price>N/ARust onlyMinimum valid quote or order price.
margin_initOption<Decimal>Decimal | None0Initial margin rate.
margin_maintOption<Decimal>Decimal | None0Maintenance margin rate.
maker_feeOption<Decimal>Decimal | None0Maker fee rate. Negative values rebate.
taker_feeOption<Decimal>Decimal | None0Taker fee rate. Negative values rebate.
tick_scheme_nameN/Astr | NoneNoneRegistered variable tick scheme name.
infoOption<Params>dict | NoneNoneAdapter metadata.

Note: Python constructors use instrument_id; Rust stores the same value as id.

Behavior

  • Equity has asset class Equity and instrument class Spot.
  • Quantity precision is always zero, so orders use whole-share quantities.
  • The multiplier and size increment are one.
  • It has no base currency, expiry, strike, option kind, or inverse costing flag.
  • Use price limits only when the venue publishes them.

Example

rust
use nautilus_core::UnixNanos;
use nautilus_model::{
    identifiers::{InstrumentId, Symbol},
    instruments::Equity,
    types::{Currency, Price, Quantity},
};
use ustr::Ustr;

let aapl = Equity::new(
    InstrumentId::from("AAPL.XNAS"),
    Symbol::from("AAPL"),
    Some(Ustr::from("US0378331005")),
    Currency::from("USD"),
    2,
    Price::from("0.01"),
    Some(Quantity::from("100")),
    None,
    None,
    None,
    None,
    None,
    None,
    None,
    None,
    None,
    UnixNanos::default(),
    UnixNanos::default(),
);
python
from nautilus_trader.model.currencies import USD
from nautilus_trader.model.identifiers import InstrumentId
from nautilus_trader.model.identifiers import Symbol
from nautilus_trader.model.instruments import Equity
from nautilus_trader.model.objects import Price
from nautilus_trader.model.objects import Quantity

aapl = Equity(
    instrument_id=InstrumentId.from_str("AAPL.XNAS"),
    raw_symbol=Symbol("AAPL"),
    isin="US0378331005",
    currency=USD,
    price_precision=2,
    price_increment=Price.from_str("0.01"),
    lot_size=Quantity.from_int(100),
    ts_event=0,
    ts_init=0,
)

Adapters

Representative adapters that create or consume Equity instruments include:

  • Data explains market data that references instruments.
  • Value types explains Price, Quantity, and Money.