Order err

joy
I tried to modify a partfilled order (1 out of 50) got filled). However the same was not modified. Can you please tell what went wrong.

in the modification request the field 'pending_quantity' is showing as 50 (since its partfilled should'nt it be 49?).

the put request we send do not have that field.

our put payload looks like this:
string.Concat("api_key=", apiKey,
"&access_token=", accessToken,
"&tradingsymbol=", kInstrument.tradingsymbol,
"&exchange=", kInstrument.exchange,
"&transaction_type=", orderAction,
"&order_type=", orderType,
"&product=", product,
"&quantity=", Math.Max(1, order.Quantity * kInstrument.lot_size),
"&price=", order.LimitPrice,
"&trigger_price=", order.StopPrice,
"&validity=", timeInForce);


heres the complete order logs

{"status": "success", "data": [{"status": "CANCELLED", "product": "CNC", "pending_quantity": 0, "order_type": "LIMIT", "exchange": "NSE", "order_id": "170405000616033", "price": 1094.02, "exchange_order_id": "1100000004464082", "order_timestamp": "2017-04-05 16:09:08", "transaction_type": "BUY", "trigger_price": 0.0, "validity": "DAY", "disclosed_quantity": 0, "status_message": null, "average_price": 1094.02, "quantity": 50}, {"status": "OPEN", "product": "CNC", "pending_quantity": 49, "order_type": "LIMIT", "exchange": "NSE", "order_id": "170405000616033", "price": 1094.02, "exchange_order_id": "1100000004464082", "order_timestamp": "2017-04-05 15:22:57", "transaction_type": "BUY", "trigger_price": 0.0, "validity": "DAY", "disclosed_quantity": 0, "status_message": "16346 : Order cannot be modified", "average_price": 1094.02, "quantity": 50}, {"status": "NOT MODIFIED", "product": "CNC", "pending_quantity": 50, "order_type": "LIMIT", "exchange": "NSE", "order_id": "170405000616033", "price": 1094.2, "exchange_order_id": "1100000004464082", "order_timestamp": "2017-04-05 15:22:57", "transaction_type": "BUY", "trigger_price": 0.0, "validity": "DAY", "disclosed_quantity": 0, "status_message": "16346 : Order cannot be modified", "average_price": 1094.02, "quantity": 50}, {"status": "OPEN", "product": "CNC", "pending_quantity": 49, "order_type": "LIMIT", "exchange": "NSE", "order_id": "170405000616033", "price": 1094.02, "exchange_order_id": "1100000004464082", "order_timestamp": "2017-04-05 15:21:36", "transaction_type": "BUY", "trigger_price": 0.0, "validity": "DAY", "disclosed_quantity": 0, "status_message": null, "average_price": 1094.02, "quantity": 50}, {"status": "MODIFY PENDING", "product": "CNC", "pending_quantity": 50, "order_type": "LIMIT", "exchange": "NSE", "order_id": "170405000616033", "price": 1094.02, "exchange_order_id": "1100000004464082", "order_timestamp": "2017-04-05 15:21:13", "transaction_type": "BUY", "trigger_price": 0.0, "validity": "DAY", "disclosed_quantity": 0, "status_message": null, "average_price": 0.0, "quantity": 50}, {"status": "MODIFY VALIDATION PENDING", "product": "CNC", "pending_quantity": 50, "order_type": "LIMIT", "exchange": "NSE", "order_id": "170405000616033", "price": 1094.02, "exchange_order_id": "1100000004464082", "order_timestamp": "2017-04-05 15:21:13", "transaction_type": "BUY", "trigger_price": 0.0, "validity": "DAY", "disclosed_quantity": 0, "status_message": null, "average_price": 0.0, "quantity": 50}, {"status": "OPEN", "product": "CNC", "pending_quantity": 50, "order_type": "LIMIT", "exchange": "NSE", "order_id": "170405000616033", "price": 1094.02, "exchange_order_id": "1100000004464082", "order_timestamp": "2017-04-05 15:04:56", "transaction_type": "BUY", "trigger_price": 0.0, "validity": "DAY", "disclosed_quantity": 0, "status_message": null, "average_price": 0.0, "quantity": 50}, {"status": "OPEN PENDING", "product": "CNC", "pending_quantity": 50, "order_type": "LIMIT", "exchange": "NSE", "order_id": "170405000616033", "price": 1094.02, "exchange_order_id": null, "order_timestamp": "2017-04-05 15:04:56", "transaction_type": "BUY", "trigger_price": 0.0, "validity": "DAY", "disclosed_quantity": 0, "status_message": null, "average_price": 0.0, "quantity": 50}, {"status": "VALIDATION PENDING", "product": "CNC", "pending_quantity": 50, "order_type": "LIMIT", "exchange": "NSE", "order_id": "170405000616033", "price": 1094.02, "exchange_order_id": null, "order_timestamp": "2017-04-05 15:04:56", "transaction_type": "BUY", "trigger_price": 0.0, "validity": "DAY", "disclosed_quantity": 0, "status_message": null, "average_price": 0.0, "quantity": 50}, {"status": "PUT ORDER REQ RECEIVED", "product": "CNC", "pending_quantity": 0, "order_type": "LIMIT", "exchange": "NSE", "order_id": "170405000616033", "price": 1094.02, "exchange_order_id": null, "order_timestamp": "2017-04-05 15:04:56", "transaction_type": "BUY", "trigger_price": 0.0, "validity": "DAY", "disclosed_quantity": 0, "status_message": null, "average_price": 0.0, "quantity": 50}]}
  • joy
    any input on this....
  • sujith
    Hi @joy,
    As you know, it is the log of all the states that an order undergoes in the system.
    It might be a intermediate state, as you can see initially it is 50 and again it comes back to 49.
    To avoid confusion, it shouldn't have logged that state only.
    We will keep it in mind for new API.
This discussion has been closed.