Message: PositionStatus

File: WebAPI/trade_routing_2.proto

Description

Status of a contract open positions and purchase and sales for a specific account for the current day (contract_id and account_id are used as a key for updates). The contract position is deleted when all open positions and purchase and sales groups are deleted.

Request: TradeSubscription.

Used in

ServerMsg

Fields

subscription_ids

Type: uint32

Description: List of trade subscription IDs this status is related to.

is_snapshot

Type: bool

Description: True if this is a snapshot related message. Since snapshot might be sent in several messages (including none), client should use TradeSnapshotCompletion message as an indicator of complete snapshot delivery.

account_id

Type: sint32

Description: Account this position belongs to.

contract_id

Type: uint32

Description: Contract ID assigned by server.

is_short_open_position (deprecated)

Type: bool

Description: True if open positions are short (result of sell operations), long otherwise. In case of separated long and short positions the value is true if the cumulative position is short or flat, the value is false if the cumulative position is long. The attribute is deprecated, refer to OpenPosition.is_short instead.

open_positions

Type: OpenPosition

Description: List of new/ updated or deleted open positions.

Note: Full list is sent only in a snapshot, updates include only added, changed and deleted records.

purchase_and_sales_groups

Type: PurchaseAndSalesGroup

Description: List of purchase and sales groups. This group represents offset trades (usually one sell and one buy).

Note: Full list is sent only in a snapshot, updates include only added, changed and deleted records.

contract_metadata

Type: metadata_2.ContractMetadata

Description: Multiple OrderStatus and PositionStatus messages in a single ServerMsg can reference the same contract. If the contract is unknown to the client before this ServerMsg, contract metadata will be added in at least one of them. If in your code, you process orders first and positions second then during processing orders you may encounter order with yet unknown contract_id. In this case, you should look for matching contract metadata in positions. The opposite is also true: contract metadata for positions can be in order status messages.

today_fill_commissions

Type: order_2.Commission

Description: Sum of today fill commissions per currency for the contract. Aggregated value from TransactionStatus.fill_commission for current day orders.