Skip to main content

Trade Updates

Method: WebSocket

Description


Retrieve updates on trades as they occur in real time.

Response Attributes


NameTypeDescription
contractGroupIdstringThe symbol id.
contractGroupNamestringThe symbol name.
contractIdstringThe contract id.
contractNamestringThe contract name.
idintegerThe Trade Id.
actionintegerValid Values:
  • 1 - Buy
  • 2 - Sell
statusintegerValid Values:
  • 1 - Open (Half-Turn)
  • 2 - Closed (Round-Turn)
createdAtdatetimeThe date and time at which the position was entered.
pairedTradeIdintegerThe trade id associated with opening the position, if this was a round-turn trade. Else, null.
pricedecimalThe price at which the position was entered.
lotsintegerThe number of lots that were traded.
tradeDaydatetimeThe trade day.
feesdecimalHalf-turn exchange and regulatory fees.
pnldecimalThe profit or loss resulting from the Trade, if a Round-Turn trade. Else, 0.
tradingAccountIdintegerThe id of the Trading Account that executed the trade.
orderIdintegerThe id of the corresponding order.
enteredAtdatetimeTime and date at which the trade was entered.
exitedAtdatetimeTime and date at which the trade was existed.
entryPricedecimalThe price at which the trade was entered.
exitPricedecimalThe price at which the trade was exited.
voidedbooleanReturns true if the trade was voided. Else, returns false.
orderCreationDispositionintegerValid Values:
  • 0 - Undetermined
  • 1 - Stop Loss
  • 2 - Take Profit
  • 3 - Close Positionn
  • 4 - Reverse Position
  • 5 - Trader

Example Usage


Example Response

{
"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
}