General Socket - Trade Events
This WebSocket allows you to receive a live update for every trade executed against your orders.
USE CASE
Receive each execution of your orders the moment it happens, with its price and quantity.
Details
- Subscribe with the
tradesaction on the raw socket, orOnTradesin the Python SDK (callbackon_trades). Nothing is delivered until you subscribe. - Each message carries a
tradeNumber(generated by the exchange) with the traded quantity and price.orderNumberis the id of the order the trade occurred for. tradedQty,tradePriceandtradeValuedescribe that execution. Useidto sort trades.exchangeOrderNois the order number provided by the exchange.orderDateTimeis in IST asDD-MM-YYYY hh:mm:ss, which differs from theDD-MMM-YYYYformat used in order events.- The raw socket message uses different key names. The SDK renames them, for example
id_filltotradeNumber,idtoorderNumber,qty_tradedtotradedQtyandprice_tradedtotradePrice.
Response Attributes - For trade update
| Attribute | Data Type | Description |
|---|---|---|
symbol | string | Eg: NSE:SBIN-EQ |
id | string | The unique id to sort the trades |
orderDateTime | string | The time when the trade occurred in “DD-MM-YYYY hh:mm:ss” format in IST |
orderNumber | string | The order id for which the trade occurred |
tradeNumber | string | The trade number generated by the exchange |
tradePrice | float | The traded price |
tradeValue | float | The total traded value |
tradedQty | int | The total traded qty |
side | int |
|
productType | string |
|
exchangeOrderNo | string | The order number provided by the exchange |
segment | int |
|
exchange | int |
|
fyToken | string | Fytoken is a unique identifier for every symbol. |
id_fyers | string | Fyers system-generated unique identifier for the order. |
Last updated on