Skip to content

ApiOpenPositionDTOv2

stonepy.models.ApiOpenPositionDTOv2.ApiOpenPositionDTOv2

Bases: ResponseModel

Information about open position.

order_id class-attribute instance-attribute

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

The order's unique identifier

market_id class-attribute instance-attribute

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

The market's unique identifier

market_name class-attribute instance-attribute

market_name: str | None = Field(
    default=None, alias="MarketName"
)

The market's name

direction class-attribute instance-attribute

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

The direction, Buy or Sell

qauantity class-attribute instance-attribute

qauantity: Decimal | None = Field(
    default=None, alias="Qauantity"
)

The quantity of the order

trigger_price class-attribute instance-attribute

trigger_price: Decimal | None = Field(
    default=None, alias="TriggerPrice"
)

Trigger price

trading_account_id class-attribute instance-attribute

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

Trading account identifier

currency class-attribute instance-attribute

currency: str | None = Field(default=None, alias="Currency")

The trade currency.

status class-attribute instance-attribute

status: int | None = Field(default=None, alias='Status')

The order status. The table of lookup codes can be found at Lookup Values

stop_order class-attribute instance-attribute

stop_order: ApiBasicStopLimitOrderDTO | None = Field(
    default=None, alias="StopOrder"
)

The stop order attached to this order

limit_order class-attribute instance-attribute

limit_order: ApiBasicStopLimitOrderDTO | None = Field(
    default=None, alias="LimitOrder"
)

The limit order attached to this order

last_changed_date_time_utc class-attribute instance-attribute

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

Represents the date and time when the trade/order was last edited in UNIX time format. Note: does not include things such as the current market price

created_date_time_utc class-attribute instance-attribute

created_date_time_utc: StoneXDateTime | None = Field(
    default=None, alias="CreatedDateTimeUTC"
)

The date and time that the order was created in UNIX time format. This can be the time an active order was created, which then become an open position after a fill. Alternatively, this can be the time a market order was executed

executed_date_time_utc class-attribute instance-attribute

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

The date time that the order executed initially in UNIX time format. This does not include any partial closures. This can be the time an active order was created, which then become an open position after a fill. Alternatively, this can be the time a market order was executed

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 market interval when the current market interval expires. Only applies to markets where the underlying is a futures contract

trade_reference class-attribute instance-attribute

trade_reference: str | None = Field(
    default=None, alias="TradeReference"
)

An alternative trade reference

managed_trades class-attribute instance-attribute

managed_trades: list[ApiManagedTradeDTO] | None = Field(
    default=None, alias="ManagedTrades"
)

The list of constituent trades for Trading Advisor managed positions (if applicable)

allocation_profile_id class-attribute instance-attribute

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

The identifier of the allocation profile that was used to create the open position, where applicable. (Used by Trade Advisor accounts)

allocation_profile_name class-attribute instance-attribute

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

The name of the allocation profile that was used to create the open position, where applicable. (Used by Trade Advisor accounts)

associated_orders class-attribute instance-attribute

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

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

fixed_initial_margin class-attribute instance-attribute

fixed_initial_margin: Decimal | None = Field(
    default=None, alias="FixedInitialMargin"
)

The fixed amount of trading resources used to place the trade

position_method_id class-attribute instance-attribute

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

Position method identifier