Trade Updates
Method: WebSocket
Description
Retrieve updates on trades as they occur in real time.
Response Attributes
| Name | Type | Description |
|---|---|---|
| contractGroupId | string | The symbol id. |
| contractGroupName | string | The symbol name. |
| contractId | string | The contract id. |
| contractName | string | The contract name. |
| id | integer | The Trade Id. |
| action | integer | Valid Values:
|
| status | integer | Valid Values:
|
| createdAt | datetime | The date and time at which the position was entered. |
| pairedTradeId | integer | The trade id associated with opening the position, if this was a round-turn trade. Else, null. |
| price | decimal | The price at which the position was entered. |
| lots | integer | The number of lots that were traded. |
| tradeDay | datetime | The trade day. |
| fees | decimal | Half-turn exchange and regulatory fees. |
| pnl | decimal | The profit or loss resulting from the Trade, if a Round-Turn trade. Else, 0. |
| tradingAccountId | integer | The id of the Trading Account that executed the trade. |
| orderId | integer | The id of the corresponding order. |
| enteredAt | datetime | Time and date at which the trade was entered. |
| exitedAt | datetime | Time and date at which the trade was existed. |
| entryPrice | decimal | The price at which the trade was entered. |
| exitPrice | decimal | The price at which the trade was exited. |
| voided | boolean | Returns true if the trade was voided. Else, returns false. |
| orderCreationDisposition | integer | Valid Values:
|
Example Usage
Example Response
- Trade Created
- Trade Updated
- Trade Deleted
{
"data": {
"id": 8508,
"contractGroupId": "F.US.MES",
"contractGroupName": "/MES",
"contractId": "CON.F.US.MES.H25",
"contractName": "MESH5",
"tradeDay": "2025-01-15T06:00:00+00:00",
"createdAt": "2025-01-15T17:35:58.566225+00:00",
"tradeDuration": null,
"price": 5975.500000000,
"fees": 0.3700,
"action": 1,
"lots": 1,
"status": 1,
"pairedTradeId": null,
"pnl": 0.000000000,
"tradingAccountId": 213,
"orderId": 14117,
"enteredAt": "2025-01-15T17:35:58.566225+00:00",
"exitedAt": null,
"entryPrice": 5975.500000000,
"exitPrice": null,
"voided": false,
"orderCreationDisposition": 0
},
"action": 0 // 0 : create, 1 : update, 2 : delete/remove
}
{
"data": {
"id": 8508,
"contractGroupId": "F.US.MES",
"contractGroupName": "/MES",
"contractId": "CON.F.US.MES.H25",
"contractName": "MESH5",
"tradeDay": "2025-01-15T06:00:00+00:00",
"createdAt": "2025-01-15T17:35:58.566225+00:00",
"tradeDuration": null,
"price": 5975.500000000,
"fees": 0.3700,
"action": 1,
"lots": 1,
"status": 1,
"pairedTradeId": null,
"pnl": 0.000000000,
"tradingAccountId": 213,
"orderId": 14117,
"enteredAt": "2025-01-15T17:35:58.566225+00:00",
"exitedAt": null,
"entryPrice": 5975.500000000,
"exitPrice": null,
"voided": false,
"orderCreationDisposition": 0
},
"action": 1 // 0 = create, 1 = update, 2 = delete/remove
}
{
"data": {
"id": 8508,
"contractGroupId": "F.US.MES",
"contractGroupName": "/MES",
"contractId": "CON.F.US.MES.H25",
"contractName": "MESH5",
"tradeDay": "2025-01-15T06:00:00+00:00",
"createdAt": "2025-01-15T17:35:58.566225+00:00",
"tradeDuration": null,
"price": 5975.500000000,
"fees": 0.3700,
"action": 1,
"lots": 1,
"status": 1,
"pairedTradeId": null,
"pnl": 0.000000000,
"tradingAccountId": 213,
"orderId": 14117,
"enteredAt": "2025-01-15T17:35:58.566225+00:00",
"exitedAt": null,
"entryPrice": 5975.500000000,
"exitPrice": null,
"voided": false,
"orderCreationDisposition": 0
},
"action": 2 // 0 = create, 1 = update, 2 = delete/remove
}