Skip to content

ApiOrderDTOv2

stonepy.models.ApiOrderDTOv2.ApiOrderDTOv2

Bases: ResponseModel

Represents an order.

order_id class-attribute instance-attribute

order_id: int | None = Field(default=None, alias='OrderId')

The order identifier

reference class-attribute instance-attribute

reference: str | None = Field(
    default=None, alias="Reference"
)

Reference identifier for the instruction

order_reference class-attribute instance-attribute

order_reference: str | None = Field(
    default=None, alias="OrderReference"
)

Reference identifier for the order

market_id class-attribute instance-attribute

market_id: int | None = Field(
    default=None, alias="MarketId"
)

A market's unique identifier

direction class-attribute instance-attribute

direction: str | None = Field(
    default=None, alias="Direction"
)

Direction identifier for trade, values supported are Buy or Sell

quantity class-attribute instance-attribute

quantity: Decimal | None = Field(
    default=None, alias="Quantity"
)

The current size of the order

original_quantity class-attribute instance-attribute

original_quantity: Decimal | None = Field(
    default=None, alias="OriginalQuantity"
)

The original size of the order before user modification

price class-attribute instance-attribute

price: Decimal | None = Field(default=None, alias='Price')

The currently set price at which the order is triggered

original_price class-attribute instance-attribute

original_price: Decimal | None = Field(
    default=None, alias="OriginalPrice"
)

The original price to trigger the order before user modification

trading_account_id class-attribute instance-attribute

trading_account_id: int | None = Field(
    default=None, alias="TradingAccountId"
)

The ID of the Trading Account associated with the order

currency_id class-attribute instance-attribute

currency_id: int | None = Field(
    default=None, alias="CurrencyId"
)

Currency ID for order (as represented in the trading system)

status_id class-attribute instance-attribute

status_id: int | None = Field(
    default=None, alias="StatusId"
)

Status ID of order (as represented in the trading system) . The table of lookup codes can be found at Lookup Values

type_id class-attribute instance-attribute

type_id: int | None = Field(default=None, alias='TypeId')

The type of the order: trade, stop or limit. The table of lookup codes can be found at Lookup Values

if_done class-attribute instance-attribute

if_done: list[ApiIfDoneDTOv2] | None = Field(
    default=None, alias="IfDone"
)

List of If/Done Orders which will be filled when the initial order is triggered

oco_order class-attribute instance-attribute

oco_order: ApiStopLimitOrderDTOv2 | None = Field(
    default=None, alias="OcoOrder"
)

Corresponding OCO Order (One Cancels the Other)

auto_rollover class-attribute instance-attribute

auto_rollover: bool | None = Field(
    default=None, alias="AutoRollover"
)

Flag to indicate whether the trade will automatically roll into the next contract when the current contract expires. Only applies to markets where the underlying is a futures contract

last_changed_date_time_utc class-attribute instance-attribute

last_changed_date_time_utc: StoneXDateTime | None = Field(
    default=None, alias="LastChangedDateTimeUTC"
)

The date and time when the order was last changed, or executed

allocation_profile_id class-attribute instance-attribute

allocation_profile_id: int | None = Field(
    default=None, alias="AllocationProfileId"
)

Allocation profile identifier

allocation_profile_name class-attribute instance-attribute

allocation_profile_name: str | None = Field(
    default=None, alias="AllocationProfileName"
)

Allocation profile name

source class-attribute instance-attribute

source: str | None = Field(default=None, alias='Source')

Source

executed_date_time_utc class-attribute instance-attribute

executed_date_time_utc: StoneXDateTime | None = Field(
    default=None, alias="ExecutedDateTimeUTC"
)

The date and time when the order was executed

associated_orders class-attribute instance-attribute

associated_orders: ApiAssociatedDTOv2 | None = Field(
    default=None, alias="AssociatedOrders"
)

Any associated orders linked to this one. An associated order is linked to a net position rather than to specific individual trades

position_method_id class-attribute instance-attribute

position_method_id: int | None = Field(
    default=None, alias="PositionMethodId"
)

Position method identifier

realized_pnl class-attribute instance-attribute

realized_pnl: Decimal | None = Field(
    default=None, alias="RealizedPNL"
)

Realized PnL

knock_out_level class-attribute instance-attribute

knock_out_level: Decimal | None = Field(
    default=None, alias="KnockOutLevel"
)

Knockout level