Every trade booked to an account alters a position in this contract.
Accounts used for strategies (Virtual Accounts or Strategy Subaccounts) may choose the type of position accounting:
When using the hedged mode, every order must specify the Position Effect — whether its execution opens a new position or closes an existing one. The field named StrategyPositionId links orders, trades, and positions.
Broker accounts always use the Netted accounting.
Executable subaccounts (ESAs) have the same accounting as the strategy they are subscribed to.
| Property | Description |
|---|---|
| OpenTradeId | ID of the last trade that affected the position. See explanation about position history below. |
| AccountId | |
| StrategyPositionId | For accounts that use Hedged accounting, an arbitrary string identifying the position. |
| ContractId | |
| Volume | Unsigned volume in contract units |
| SignedVolume | |
| Side | |
| OpenPrice | TotalOpenPayments / Volume |
| TotalOpenPayments | Sum of the payments of all trades that increased the position |
| OpenDt | Initial open timestamp |
| HistoryOpenDt | Timestamp of the last change (due to the trade or end of day) |
| TotalSettlPayments | Value of the position at the last end of day in the settlement/quote currency |
| TotalSettlPaymentsInAccountCcy | |
| SettlPrice | TotalSettlPayments / Volume |
| CloseTradeId | Only for positions history — reference to the trade that changed the position |
| ClosePrice | Only for positions history. See explanation about position history below |
| CloseDt | Only for positions history |
| IsClosed | |
| RealizedPnL | Gross PnL (not accounting for commissions) attributed to this position history record |
| RealizedPnLInAccountCcy | |
| FloatingPnL | Daily floating PnL attributed to this position history record |
| TotalFloatingPnL | |
| Commission | Total commission attributed to this part of the position. |
| For opened positions it equals the sum of commissions of opening trades, for closed positions — commissions of opening trades and the closing trade. | |
| SignalGroupId | |
| IsSynthetic | Whether the contract is synthetic |
| ParentPositionId | For positions that are real positions in legs of a synthetic contract, contains the reference to the parent position in the synthetic contract |
| ChangeType | Only for position history records — the type of the change: |
| • Open | |
| • Close | |
| • MTM (mark to market at the end of day) |
Whenever a position changes, a history record is saved to indicate the position's state at that time. For example:
Position history allows us to see the actual positions at any moment in time (by selecting history records with HistoryOpenDt ≤ timestamp and CloseDt ≥ timestamp) and helps build P&L reports.
At the end of each day (the exact time is determined by platform-wide settings), all active positions and balances are marked to market. For contracts quoted or settled in currencies different from the account base currency, the value is converted to the account currency. The account's total equity is recorded and compared with the equity at the end of the previous day to calculate the daily PnL.
Yield also accounts for the changes in the investment; see details here.