Position Updates
Method: WebSocket
Description
Retrieve updates on positions as they occur in real time.
Response Attributes
| Name | Type | Description |
|---|---|---|
| id | integer | The id associated with the Position. |
| symbolId | string | The symbol associated with the Position. |
| openPnl | decimal | The profit and loss associated with the open position. |
| positionSize | integer | The size of the Position. A positive value is a long position. A negative value is a short position. |
| averagePrice | decimal | The average entry price of the Position. |
| contract | string | The contract associated with the Position. |
| contractId | string | The contract id associated with the Position. |
| contractGroup | string | The contract group associated with the Position. |
| tradingAccountId | integer | The id of the Trading Account associated with the Position. |
| timestamp | datetime | The timestamp indicating when the information was sent from the backend. |
| createdAt | datetime | The date and time when the Position created. |
| updatedAt | datetime | The date and time when the Position was updated. |
| stopLoss | decimal | The price at which the Stop Loss will execute. |
| takeProfit | decimal | The price at which the Take Profit order will execute. |
| toMake | decimal | The To Make value associated with the Position. |
| risk | decimal | The Risk value associated with the Position |
| stopLossOrderId | integer | The order id associated with the Position's Stop Loss. |
| takeProfitOrderId | integer | The order id associated with the Position's Take Profit. |
Example Usage
Example Response
- Position Created
- Position Updated
- Position Deleted
{
"data": {
"id": 4231,
"symbolId": "F.US.BP6",
"openPnl": -18.75,
"positionSize": 0,
"averagePrice": 1.2665,
"contract": "6BH5",
"contractId": null,
"contractGroup": "/6B",
"tradingAccountId": 233,
"timestamp": "2025-02-25T19:20:49.885871+00:00",
"createdAt": "2025-02-25T18:57:39.542302+00:00",
"updatedAt": "2025-02-25T19:19:28.829349+00:00",
"stopLoss": null,
"takeProfit": null,
"toMake": null,
"risk": null,
"stopLossOrderId": null,
"takeProfitOrderId": null
},
"action": 0 // 0 = create, 1 = update, 2 = delete/remove
}
{
"data": {
"id": 4231,
"symbolId": "F.US.BP6",
"openPnl": -18.75,
"positionSize": 0,
"averagePrice": 1.2665,
"contract": "6BH5",
"contractId": null,
"contractGroup": "/6B",
"tradingAccountId": 233,
"timestamp": "2025-02-25T19:20:49.885871+00:00",
"createdAt": "2025-02-25T18:57:39.542302+00:00",
"updatedAt": "2025-02-25T19:19:28.829349+00:00",
"stopLoss": null,
"takeProfit": null,
"toMake": null,
"risk": null,
"stopLossOrderId": null,
"takeProfitOrderId": null
},
"action": 1 // 0 = create, 1 = update, 2 = delete/remove
}
{
"data": {
"id": 2184,
"symbolId": "F.US.ENQ",
"symbolName": "/NQ",
"positionSize": 1,
"stopLoss": 21202.75,
"takeProfit": 21215.25,
"toMake": 125.0,
"risk": 125.0,
"averagePrice": 21209.0,
"profitAndLoss": -5.0,
"entryTime": "2024-12-02T19:53:19.0343325Z",
"accountId": 179,
"stopLossOrderId": 6607,
"takeProfitOrderId": 6608,
"contractId": "CON.F.US.ENQ.Z24"
},
"action": 2 // 0 = create, 1 = update, 2 = delete/remove
}