pocketful logo light
pocketful logo light

Trade Updates

Trade updates are vital in algorithmic trading as they offer real-time insights into executed trades, enabling accurate tracking of filled orders, performance analysis, and portfolio adjustments. These updates help algorithms fine-tune strategies based on actual trade outcomes, manage positions effectively, and mitigate risks such as over-exposure. In algo trading, timely trade updates are crucial for optimizing execution, reducing market impact, and ensuring compliance with post-trade reporting and regulatory obligations, ultimately influencing profitability and operational performance.

Subscribe to get trade updates

response = pocket_ws.subscribe_trade_update()

Read trade updates

trade_updates = pocket_ws.read_trade_update_data()

Trade Updates Response

{
    "error": {
        "code": 0,
        "message": ""
    },
    "result": [
        {
            "client_id": "SB3179",
            "exchange": "NSE",
            "exchange_order_id": "1200000014631276",
            "exchange_time": 1641201487,
            "filled_quantity": 1,
            "instrument_token": 10666,
            "login_id": "SB3179",
            "oms_order_id": "20220103-1891",
            "order_side": "BUY",
            "pro_cli": "CLIENT",
            "product": "CNC",
            "trade_id": "53768151",
            "trade_price": 38,
            "trading_symbol": "PNB-EQ",
            "transaction_type": null,
            "user_order_id": "10002",
            "v_login_id": null
        }
    ]
}

Response

FieldDescription
client_idUnique identifier for the client placing the order.
exchangeThe financial exchange where the order was executed (e.g., NSE).
exchange_order_idThe order ID assigned by the exchange for tracking.
exchange_timeTimestamp indicating when the order was recognized by the exchange.
filled_quantityThe number of shares or contracts that have been filled from the order.
instrument_tokenUnique token identifying the instrument traded.
login_idIdentifier for the login session of the client.
oms_order_idThe order management system (OMS) ID assigned to the order.
order_sideIndicates whether the order is a buy or sell (e.g., BUY).
pro_cliIndicates if the client is a professional trader or retail client.
productType of product traded (e.g., CNC for delivery trades).
trade_idUnique identifier for the trade executed.
trade_priceThe price at which the trade was executed.
trading_symbolThe symbol used to represent the traded instrument (e.g., PNB-EQ).
transaction_typeType of transaction (e.g., market, limit); null indicates it’s not specified.
user_order_idIdentifier for the order as provided by the user.
v_login_idA placeholder for an alternative login identifier; often null.

Unsubscribe trade updates

response = pocket_ws.unsubscribe_trade_update()