General Socket - Order Events
This WebSocket allows you to receive live updates on the status of your orders, including partial fills and rejections.
USE CASE
Receive an update the moment one of your orders is placed, modified, traded or rejected.
Details
- The WebSocket API for receiving order, position, trade, price alerts, and EDIS updates is a real-time communication protocol designed to provide seamless access to various critical elements of a trading and EDIS system. This API allows traders and developers to establish a persistent, bidirectional connection with the server, enabling them to receive real-time updates on their orders, current positions, executed trades, price alerts, and EDIS status.
- Subscribe with the
ordersaction on the raw socket, orOnOrdersin the Python SDK (callbackon_orders). Nothing is delivered until you subscribe. - Match each update to your order with
id.exchOrdIdis the exchange order id andid_fyersis the FYERS-generated unique identifier. - Read
statusto track the order: 1 canceled, 2 traded, 4 transit, 5 rejected, 6 pending, 7 expired (3 is not used).messagecarries error text. filledQtyandremainingQuantityshow how much has traded and what is left after partial trades.tradedPriceis the average traded price.offlineOrderis true for an AMO order and false when the market is open.parentIdis sent only for orders where it applies.orderDateTimeis in IST asDD-MMM-YYYY hh:mm:ss, for example04-Aug-2023 10:12:58.- The raw socket message uses different key names. The SDK renames them, for example
org_ord_statustostatusandqty_remainingtoremainingQuantity. See the key mappers on General WebSocket - Subscribe.
Response Attributes - For order updates
| Attribute | Data Type | Description |
|---|---|---|
id | string | The unique order id assigned for each order |
exchOrdId | string | The order id provided by the exchange |
symbol | string | The symbol for which order is placed |
qty | int | The original order qty |
remainingQuantity | int | The remaining qty |
filledQty | int | The filled qty after partial trades |
status | int |
|
message | string | The error messages are shown here |
segment | int |
|
limitPrice | float | The limit price for the order |
stopPrice | float | The limit price for the order |
productType | string | The product type |
type | int |
|
side | int |
|
orderValidity | string |
|
orderDateTime | string | The order time as per DD-MMM-YYYY hh:mm:ss in IST |
parentId | string | The parent order id will be provided only for applicable orders. |
tradedPrice | float | The average traded price for the order |
source | string |
|
fytoken | string |
|
offlineOrder | boolean |
|
pan | string | PAN of the client |
clientId | string | The client id of the fyers user |
exchange | int |
|
instrument | int |
|
id_fyers | string | Fyers system-generated unique identifier for the order. |
Last updated on