Skip to content

Identifiers

Loren1166 edited this page Sep 24, 2024 · 1 revision

Identifiers 标识符

class AccountId 账户ID

class AccountId(Identifier):
    """
    AccountId(unicode value) -> None

    Represents a valid account ID. 
    表示一个有效的账户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. 
    必须使用连字符分隔的两个有效字符串正确格式化。预计账户 ID 是发行者名称和账户号码,中间用连字符分隔。

    Example: “IB-D02851908”. 
    例如:“IB-D02851908”。

    Parameters:
        value (str) – The account ID value. 
        value (str) - 账户 ID 值。
    Raises:
        ValueError – If value is not a valid string containing a hyphen. 
        ValueError - 如果 value 不是包含连字符的有效字符串。
    WARNING
        The issuer and number ID combination must be unique at the firm level. 
        发行者和号码 ID 组合在公司级别必须是唯一的。
    """

    def __init__(self, value: str) -> None:
        ...

    def get_id(self) -> str:
        """
        Return the account ID without issuer name. 
        返回不包含发行者名称的账户 ID。

        Return type:
            str
        """
        ...

    def get_issuer(self) -> str:
        """
        Return the account issuer for this ID. 
        返回此 ID 的账户发行者。

        Return type:
            str
        """
        ...

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...

class ClientId 客户端ID

class ClientId(Identifier):
    """
    ClientId(unicode value) -> None

    Represents a system client ID. 
    表示一个系统客户端 ID。

    Parameters:
        value (str) – The client ID value. 
        value (str) - 客户端 ID 值。
    Raises:
        ValueError – If value is not a valid string. 
        ValueError - 如果 value 不是有效的字符串。
    WARNING
        The ID value must be unique at the trader level. 
        ID 值在交易者级别必须是唯一的。
    """

    def __init__(self, value: str) -> None:
        ...

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...

class ClientOrderId 客户订单ID

class ClientOrderId(Identifier):
    """
    ClientOrderId(unicode value) -> None

    Represents a valid client order ID (assigned by the Nautilus system). 
    表示一个有效的客户订单ID(由 Nautilus 系统分配)。

    Parameters:
        value (str) – The client order ID value. 
        value (str) - 客户订单 ID 值。
    Raises:
        ValueError – If value is not a valid string. 
        ValueError - 如果 value 不是有效的字符串。
    WARNING
        The ID value must be unique at the firm level. 
        ID 值在公司级别必须是唯一的。
    """

    def __init__(self, value: str) -> None:
        ...

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...

class ComponentId 组件ID

class ComponentId(Identifier):
    """
    ComponentId(unicode value) -> None

    Represents a valid component ID. 
    表示一个有效的组件ID。

    Parameters:
        value (str) – The component ID value. 
        value (str) - 组件 ID 值。
    Raises:
        ValueError – If value is not a valid string. 
        ValueError - 如果 value 不是有效的字符串。
    WARNING
        The ID value must be unique at the trader level. 
        ID 值在交易者级别必须是唯一的。
    """

    def __init__(self, value: str) -> None:
        ...

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...

class ExecAlgorithmId 执行算法ID

class ExecAlgorithmId(Identifier):
    """
    ExecAlgorithmId(unicode value) -> None

    Represents a valid execution algorithm ID. 
    表示一个有效的执行算法ID。

    Parameters:
        value (str) – The execution algorithm ID value. 
        value (str) - 执行算法 ID 值。
    Raises:
        ValueError – If value is not a valid string. 
        ValueError - 如果 value 不是有效的字符串。
    """

    def __init__(self, value: str) -> None:
        ...

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...

class Identifier 标识符

class Identifier(object):
    """
    The abstract base class for all identifiers. 
    所有标识符的抽象基类。
    """

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...

class InstrumentId 金融工具ID

class InstrumentId(Identifier):
    """
    InstrumentId(Symbol symbol, Venue venue) -> None

    Represents a valid instrument ID. 
    表示一个有效的金融工具ID。

    The symbol and venue combination should uniquely identify the instrument. 
    代码和交易场所的组合应该唯一地标识金融工具。

    Parameters:
        symbol (Symbol) – The instruments ticker symbol. 
        symbol (Symbol) - 金融工具的代码。
        venue (Venue) – The instruments trading venue. 
        venue (Venue) - 金融工具的交易场所。
    """

    def __init__(self, symbol: "Symbol", venue: "Venue") -> None:
        ...

    @staticmethod
    def from_str(value: str) -> "InstrumentId":
        """
        Return an instrument ID parsed from the given string value. Must be correctly formatted including symbol and venue components either side of a single period. 
        从给定的字符串值解析金融工具 ID。必须正确格式化,包括句点两边的代码和交易场所组件。

        Examples: ‘AUD/USD.IDEALPRO’, ‘BTCUSDT.BINANCE’ 
        例如:“AUD/USD.IDEALPRO”、“BTCUSDT.BINANCE”

        Parameters:
            value (str) – The instrument ID string value to parse. 
            value (str) - 要解析的金融工具 ID 字符串值。
        Return type:
            InstrumentId
        Raises:
            ValueError – If value is not a valid instrument ID string. 
            ValueError - 如果 value 不是有效的金融工具 ID 字符串。
        """
        ...

    def is_synthetic(self) -> bool:
        """
        Return whether the instrument ID is a synthetic instrument (with venue of ‘SYNTH’). 
        返回金融工具 ID 是否为合成金融工具(交易场所为“SYNTH”)。

        Return type:
            bool
        """
        ...

    @property
    def symbol(self) -> "Symbol":
        """
        Symbol

        Returns the instrument ticker symbol. 
        返回金融工具的代码。

        Return type:
            Symbol
        Type:
            InstrumentId.symbol
        """
        ...

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...

    @property
    def venue(self) -> "Venue":
        """
        Venue

        Returns the instrument trading venue. 
        返回金融工具的交易场所。

        Return type:
            Venue
        Type:
            InstrumentId.venue
        """
        ...

class OrderListId 订单列表ID

class OrderListId(Identifier):
    """
    OrderListId(unicode value) -> None

    Represents a valid order list ID (assigned by the Nautilus system). 
    表示一个有效的订单列表 ID(由 Nautilus 系统分配)。

    Parameters:
        value (str) – The order list ID value. 
        value (str) - 订单列表 ID 值。
    Raises:
        ValueError – If value is not a valid string. 
        ValueError - 如果 value 不是有效的字符串。
    """

    def __init__(self, value: str) -> None:
        ...

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...

class PositionId 头寸ID

class PositionId(Identifier):
    """
    PositionId(unicode value) -> None

    Represents a valid position ID. 
    表示一个有效的头寸ID。

    Parameters:
        value (str) – The position ID value. 
        value (str) - 头寸 ID 值。
    Raises:
        ValueError – If value is not a valid string containing a hyphen. 
        ValueError - 如果 value 不是包含连字符的有效字符串。
    """

    def __init__(self, value: str) -> None:
        ...

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...

class StrategyId 策略ID

class StrategyId(Identifier):
    """
    StrategyId(unicode value) -> None

    Represents a valid strategy ID. 
    表示一个有效的策略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. 
    必须使用连字符分隔的两个有效字符串正确格式化。预计策略 ID 是策略的类名和订单 ID 标签号,中间用连字符分隔。

    Example: “EMACross-001”. 
    例如:“EMACross-001”。

    The reason for the numerical component of the ID is so that order and position IDs do not collide with those from another strategy within the node instance. 
    ID 中包含数字组件的原因是为了防止订单和头寸 ID 与节点实例中其他策略的订单和头寸 ID 冲突。

    Parameters:
        value (str) – The strategy ID value. 
        value (str) - 策略 ID 值。
    Raises:
        ValueError – If value is not a valid string containing a hyphen. 
        ValueError - 如果 value 不是包含连字符的有效字符串。
    WARNING
        The name and tag combination must be unique at the trader level. 
        名称和标签组合在交易者级别必须是唯一的。
    """

    def __init__(self, value: str) -> None:
        ...

    def get_tag(self) -> str:
        """
        Return the order ID tag value for this ID. 
        返回此 ID 的订单 ID 标签值。

        Return type:
            str
        """
        ...

    def 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. 
        如果策略 ID 是全局“外部”策略。这表示与该系统实例交互的所有订单的策略,这些订单并非源自系统管理的任何策略。

        Return type:
            bool
        """
        ...

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...

class Symbol 代码

class Symbol(Identifier):
    """
    Symbol(unicode value) -> None

    Represents a valid ticker symbol ID for a tradable instrument. 
    表示一个可交易金融工具的有效代码 ID。

    Parameters:
        value (str) – The ticker symbol ID value. 
        value (str) - 代码 ID 值。
    Raises:
        ValueError – If value is not a valid string. 
        ValueError - 如果 value 不是有效的字符串。
    WARNING
        The ID value must be unique for a trading venue. 
        ID 值对于交易场所必须是唯一的。
    """

    def __init__(self, value: str) -> None:
        ...

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...

class TradeId 交易ID

class TradeId(Identifier):
    """
    TradeId(unicode value) -> None

    Represents a valid trade match ID (assigned by a trading venue). 
    表示一个有效的交易匹配 ID(由交易场所分配)。

    Maximum length is 36 characters. Can correspond to the TradeID <1003> field of the FIX protocol. 
    最大长度为 36 个字符。可以对应 FIX 协议的 TradeID <1003> 字段。

    The unique ID assigned to the trade entity once it is received or matched by the exchange or central counterparty. 
    一旦交易实体被交易所或中央对手方接收或匹配,就会分配给它的唯一 ID。

    Parameters:
        value (str) – The trade match ID value. 
        value (str) - 交易匹配 ID 值。
    Raises:
        ValueError – If value is not a valid string. 
        ValueError - 如果 value 不是有效的字符串。
        ValueError – If value length exceeds maximum 36 characters. 
        ValueError - 如果 value 长度超过最大 36 个字符。
    """

    def __init__(self, value: str) -> None:
        ...

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...

class TraderId 交易者ID

class TraderId(Identifier):
    """
    TraderId(unicode value) -> None

    Represents a valid trader ID. 
    表示一个有效的交易者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. 
    必须使用连字符分隔的两个有效字符串正确格式化。预计交易者 ID 是交易者的缩写名称和订单 ID 标签号,中间用连字符分隔。

    Example: “TESTER-001”. 
    例如:“TESTER-001”。

    The reason for the numerical component of the ID is so that order and position IDs do not collide with those from another node instance. 
    ID 中包含数字组件的原因是为了防止订单和头寸 ID 与其他节点实例的订单和头寸 ID 冲突。

    Parameters:
        value (str) – The trader ID value. 
        value (str) - 交易者 ID 值。
    Raises:
        ValueError – If value is not a valid string containing a hyphen. 
        ValueError - 如果 value 不是包含连字符的有效字符串。
    WARNING
        The name and tag combination ID value must be unique at the firm level. 
        名称和标签组合 ID 值在公司级别必须是唯一的。
    """

    def __init__(self, value: str) -> None:
        ...

    def get_tag(self) -> str:
        """
        Return the order ID tag value for this ID. 
        返回此 ID 的订单 ID 标签值。

        Return type:
            str
        """
        ...

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...

class Venue 交易场所

class Venue(Identifier):
    """
    Venue(unicode name) -> None

    Represents a valid trading venue ID. 
    表示一个有效的交易场所ID。

    Parameters:
        name (str) – The venue ID value. 
        name (str) - 交易场所 ID 值。
    Raises:
        ValueError – If name is not a valid string. 
        ValueError - 如果 name 不是有效的字符串。
    """

    def __init__(self, name: str) -> None:
        ...

    @staticmethod
    def from_code(code: str):
        """
        Return the venue with the given code from the built-in internal map (if found). 
        从内置的内部映射中返回具有给定代码的交易场所(如果找到)。

        Currency only supports CME Globex exchange ISO 10383 MIC codes. 
        货币仅支持 CME Globex 交易所的 ISO 10383 MIC 代码。

        Parameters:
            code (str) – The code of the venue. 
            code (str) - 交易场所的代码。
        Return type:
            Venue or None
        """
        ...

    def is_synthetic(self) -> bool:
        """
        Return whether the venue is synthetic (‘SYNTH’). 
        返回交易场所是否为合成交易场所(“SYNTH”)。

        Return type:
            bool
        """
        ...

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...

class VenueOrderId 交易场所订单ID

class VenueOrderId(Identifier):
    """
    VenueOrderId(unicode value) -> None

    Represents a valid venue order ID (assigned by a trading venue). 
    表示一个有效的交易场所订单ID(由交易场所分配)。

    Parameters:
        value (str) – The venue assigned order ID value. 
        value (str) - 交易场所分配的订单 ID 值。
    Raises:
        ValueError – If value is not a valid string. 
        ValueError - 如果 value 不是有效的字符串。
    """

    def __init__(self, value: str) -> None:
        ...

    @property
    def value(self) -> str:
        """
        str

        Return the identifier (ID) value. 
        返回标识符(ID)值。

        Return type:
            str
        Type:
            Identifier.value
        """
        ...
文档 (Documentation)
入门 (Getting Started)
概念 (Concepts)
教程 (Tutorials)
集成 (Integrations)
Python API
Rust API[未翻译]
开发者指南 (Developer Guide)
Clone this wiki locally