Identifiers

class AccountId ( unicode value )

Bases: nautilus_trader.model.identifiers.Identifier

Represents a valid account ID.

Must be correctly formatted with two valid strings either side of a hyphen. It is expected an account ID is the name of the issuer with an account number separated by a hyphen.

Example: “IB-D02851908”.

Parameters

value ( str ) – The account ID value.

Raises

ValueError – If value is not a valid string.

Warning

The issuer and number ID combination must be unique at the firm level.

get_issuer ( self ) unicode

Return the account issuer for this ID.

Returns

str

value

Return the identifier (ID) value.

Returns

str

class ClientId ( unicode value )

Bases: nautilus_trader.model.identifiers.ComponentId

Represents a system client ID.

Parameters

value ( str ) – The client ID value.

Raises

ValueError – If value is not a valid string.

Warning

The ID value must be unique at the trader level.

value

Return the identifier (ID) value.

Returns

str

class ClientOrderId ( unicode value )

Bases: nautilus_trader.model.identifiers.Identifier

Represents a valid client order ID (assigned by the Nautilus system).

Parameters

value ( str ) – The client order ID value.

Raises

ValueError – If value is not a valid string.

Warning

The ID value must be unique at the firm level.

value

Return the identifier (ID) value.

Returns

str

class ComponentId ( unicode value )

Bases: nautilus_trader.model.identifiers.Identifier

Represents a valid component ID.

Parameters

value ( str ) – The component ID value.

Raises

ValueError – If value is not a valid string.

Warning

The ID value must be unique at the trader level.

value

Return the identifier (ID) value.

Returns

str

class Identifier

Bases: object

The base class for all identifiers.

value

Return the identifier (ID) value.

Returns

str

class InstrumentId ( Symbol symbol , Venue venue )

Bases: nautilus_trader.model.identifiers.Identifier

Represents a valid instrument ID.

The symbol and venue combination should uniquely identify the instrument.

Parameters
  • symbol ( Symbol ) – The instruments ticker symbol.

  • venue ( Venue ) – The instruments trading venue.

static from_str ( unicode value: str ) InstrumentId

Return an instrument ID parsed from the given string value. Must be correctly formatted including characters either side of a single period.

Examples: “AUD/USD.IDEALPRO”, “BTCUSDT.BINANCE”

Parameters

value ( str ) – The instrument ID string value to parse.

Returns

InstrumentId

symbol

The instrument ticker symbol.

Returns

Symbol

value

Return the identifier (ID) value.

Returns

str

venue

The instrument trading venue.

Returns

Venue

class OrderListId ( unicode value )

Bases: nautilus_trader.model.identifiers.Identifier

Represents a valid order list ID (assigned by the Nautilus system).

Parameters

value ( str ) – The order list ID value.

Raises

ValueError – If value is not a valid string.

value

Return the identifier (ID) value.

Returns

str

class PositionId ( unicode value )

Bases: nautilus_trader.model.identifiers.Identifier

Represents a valid position ID.

Parameters

value ( str ) – The position ID value.

Raises

ValueError – If value is not a valid string.

value

Return the identifier (ID) value.

Returns

str

class StrategyId ( unicode value )

Bases: nautilus_trader.model.identifiers.ComponentId

Represents a valid strategy ID.

Must be correctly formatted with two valid strings either side of a hyphen. It is expected a strategy ID is the class name of the strategy, with an order ID tag number separated by a hyphen.

Example: “EMACross-001”.

Parameters

value ( str ) – The strategy ID value.

Raises

ValueError – If value is not a valid string containing a hyphen.

Warning

The name and tag combination must be unique at the trader level.

get_tag ( self ) unicode

Return the order ID tag value for this ID.

Returns

str

is_external ( self ) bool

If the strategy ID is the global ‘external’ strategy. This represents the strategy for all orders interacting with this instance of the system which did not originate from any strategy being managed by the system.

Returns

bool

value

Return the identifier (ID) value.

Returns

str

class Symbol ( unicode value )

Bases: nautilus_trader.model.identifiers.Identifier

Represents a valid ticker symbol ID for a tradable financial market instrument.

Parameters

value ( str ) – The ticker symbol ID value.

Raises

ValueError – If value is not a valid string.

Warning

The ID value must be unique for a trading venue.

References

https://en.wikipedia.org/wiki/Ticker_symbol

value

Return the identifier (ID) value.

Returns

str

class TradeId ( unicode value )

Bases: nautilus_trader.model.identifiers.Identifier

Represents a valid trade match ID (assigned by a trading venue).

Can correspond to the TradeID <1003> field of the FIX protocol.

The unique ID assigned to the trade entity once it is received or matched by the exchange or central counterparty.

Parameters

value ( str ) – The trade match ID value.

Raises

ValueError – If value is not a valid string.

References

https://www.onixs.biz/fix-dictionary/5.0/tagnum_1003.html

value

Return the identifier (ID) value.

Returns

str

class TraderId ( unicode value )

Bases: nautilus_trader.model.identifiers.ComponentId

Represents a valid trader ID.

Must be correctly formatted with two valid strings either side of a hyphen. It is expected a trader ID is the abbreviated name of the trader with an order ID tag number separated by a hyphen.

Example: “TESTER-001”.

Parameters

value ( str ) – The trader ID value.

Raises

ValueError – If value is not a valid string containing a hyphen.

Warning

The name and tag combination ID value must be unique at the firm level.

get_tag ( self ) unicode

Return the order ID tag value for this ID.

Returns

str

value

Return the identifier (ID) value.

Returns

str

class Venue ( unicode name )

Bases: nautilus_trader.model.identifiers.Identifier

Represents a valid trading venue ID.

Parameters

name ( str ) – The venue ID value.

Raises

ValueError – If name is not a valid string.

value

Return the identifier (ID) value.

Returns

str

class VenueOrderId ( unicode value )

Bases: nautilus_trader.model.identifiers.Identifier

Represents a valid venue order ID (assigned by a trading venue).

Parameters

value ( str ) – The venue assigned order ID value.

Raises

ValueError – If value is not a valid string.

value

Return the identifier (ID) value.

Returns

str