pocketful logo light
pocketful logo light

Order Updates

Live order updates are essential in algorithmic trading as they provide real-time data crucial for making swift decisions, managing risk effectively, and capturing fleeting arbitrage opportunities. These updates allow algorithms to adjust strategies instantly, reduce slippage, and ensure compliance with regulatory requirements, directly impacting profitability and operational efficiency in algo trading environments. To get order updates, trader needs to subscribe first to order updates via python library.

Subscribe to get order updates

response = pocket_ws.subscribe_order_update()

Read order updates

order_updates = pocket_ws.read_order_update_data()

Order Updates Response

{
    "error":{
    "code": 0,
    "message": ""},
    "result": [
    {
    "average_price": 0,
    "average_trade_price": 0,
    "client_id": "SB3179",
    "deposit": 0,
    "device": "",
    "disclosed_quantity": 0,
    "exchange": "NSE",
    "exchange_order_id": "1200000008791186",
    "exchange_time": 1641191673,
    "execution_type": "REGULAR",
    "filled_quantity": 0,
    "instrument_token": 10666,
    "last_activity_reference": 1325678673994464800,
    "leg_order_indicator": "",
    "login_id": "SB3179",
    "lot_size": 0,
    "lotsize": 1,
    "market_protection_percentage": 0,
    "mode": "MODIFY",
    "nest_request_id": "",
    "nnfid": 111111111111100,
    "oms_order_id": "20220103-1157",
    "order_entry_time": 1641191331,
    "order_side": "BUY",
    "order_status": "MODCONFIRMED",
    "order_type": "LIMIT",
    "price": 36.95,
    "pro_cli": "CLIENT",
    "product": "MIS",
    "quantity": 1,
    "rejection_code": "NONE",
    "rejection_reason": "NONE",
    "remaining_quantity": 1,
    "series": "",
    "spread_token": "",
    "trade_price": 0,
    "trading_symbol": "PNB-EQ",
    "transaction_type": "LIMIT",
    "trigger_price": 0,
    "user_order_id": "10002",
    "validity": "DAY",
    }]
}
FieldDescription
average_priceThe average price at which the order has been executed so far.
average_trade_priceThe average price of trades related to this order.
client_idUnique identifier for the client.
depositAmount deposited, relevant in some trading contexts.
deviceDevice used for placing the order, if applicable.
disclosed_quantityThe quantity of the order disclosed to the market.
exchangeThe financial exchange where the order is placed (e.g., NSE).
exchange_order_idThe order ID assigned by the exchange.
exchange_timeTimestamp of when the order was recognized by the exchange.
execution_typeType of order execution (e.g., REGULAR).
filled_quantityQuantity of the order that has been filled.
instrument_tokenUnique identifier for the financial instrument.
last_activity_referenceReference to the last activity associated with this order.
leg_order_indicatorIndicates if the order is part of a multi-leg strategy.
login_idLogin identifier for the user who placed the order.
lot_sizeThe size of a standard lot of the instrument.
lotsizeAnother reference to lot size, possibly due to system variations.
market_protection_percentagePercentage of market protection, if applicable.
modeMode of the order (e.g., MODIFY).
nest_request_idIdentifier for the request in the trading system.
nnfidNetwork node financial ID, a system-specific identifier.
oms_order_idOrder management system identifier for the order.
order_entry_timeTimestamp when the order was entered into the system.
order_sideIndicates whether the order is a BUY or SELL.
order_statusCurrent status of the order (e.g., MODCONFIRMED).
order_typeType of order (e.g., LIMIT, MARKET).
pricePrice specified in the order.
pro_cliIndicates whether the order is placed by a professional or client.
productTrading product or strategy (e.g., MIS, CNC).
quantityQuantity ordered.
rejection_codeCode indicating reason for rejection, if any.
rejection_reasonTextual reason for any rejection of the order.
remaining_quantityQuantity of the order that remains unfilled.
seriesFinancial series or category if applicable.
spread_tokenToken related to spread orders, if applicable.
trade_priceThe price at which the last trade occurred.
trading_symbolThe trading symbol or ticker of the instrument.
transaction_typeIndicates the type of transaction (e.g., LIMIT, MARKET).
trigger_pricePrice at which a trigger-based order activates.
user_order_idUser-defined order identifier.
validityValidity of the order (e.g., DAY, IOC).

Unsubscribe order updates

response = pocket_ws.unsubscribe_order_update()