kite.orders api showing open orders status as trigger pending

srinu124
I am using kite.orders() to print open and trigger pending orders, its showing open orders ( open cover orders which are not triggered yet) as trigger pending..

tradingsymbol transaction_type price status filled_quantity pending_quantity order_id parent_order_id average_price trigger_price order_type
--------------- ------------------ ------- --------------- ----------------- ------------------ --------------- ----------------- --------------- --------------- ------------
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200612313 210430200612311 0 1063 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200734418 210430200734411 0 1047 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200485525 210430200485524 0 1046 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200491179 210430200491164 0 1047 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200505113 210430200505111 0 1046 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200520540 210430200520537 0 1047 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200510009 210430200509370 0 1047 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200594625 210430200594624 0 1046 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200512403 210430200512385 0 1046 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200513748 210430200513743 0 1047 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200481906 210430200481900 0 1046 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200487157 210430200487156 0 1047 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200471471 210430200471467 0 1046 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200597832 210430200597823 0 1047 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430201527370 210430201527368 0 1046 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430201584637 210430201584634 0 1047.2 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430201585262 210430201585259 0 1047.4 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430201585545 210430201585538 0 1047.8 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430201585850 210430201585845 0 1047.8 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430201586253 210430201586250 0 1047.9 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430200712848 210430200712843 0 1041 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430201528668 210430201528667 0 1041 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430201758737 210430201758731 0 1044 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430201759051 210430201759050 0 1043 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430201759540 210430201759539 0 1042.4 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430201760253 210430201760249 0 1042.8 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430201760653 210430201760651 0 1045 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430201760916 210430201760911 0 1046 SL-M
TATASTEEL BUY 0 TRIGGER PENDING 0 100 210430201761760 210430201761759 0 1044 SL-M

Below are the open orders which are shown under trigger pending..

tradingsymbol transaction_type price status filled_quantity pending_quantity order_id parent_order_id average_price trigger_price order_type
--------------- ------------------ ------- -------- ----------------- ------------------ --------------- ----------------- --------------- --------------- ------------
TATASTEEL SELL 1032 OPEN 0 100 210430201758731 0 1044 LIMIT
TATASTEEL SELL 1031 OPEN 0 100 210430201759050 0 1043 LIMIT
TATASTEEL SELL 1030.8 OPEN 0 100 210430201760249 0 1042.8 LIMIT
TATASTEEL SELL 1033 OPEN 0 100 210430201760651 0 1045 LIMIT
TATASTEEL SELL 1034 OPEN 0 100 210430201760911 0 1046 LIMIT
TATASTEEL SELL 1032 OPEN 0 100 210430201761759 0 1044 LIMIT
TATASTEEL SELL 1030 OPEN 0 100 210430201763642 0 1042 LIMIT]
  • srinu124
    kite.orders() is returning 2 entries for open cover orders. one with status as OPEN and other with status as TRIGGER PENDING..
  • sujith
    You can know more about cover order here.
  • srinu124
    I am using these APIs from more than an year. It used to work fine before. Could you please check if there is any API issue?
  • sujith
    When you place a cover order with an entry type limit the first leg will be OPEN status and the second leg will be TRIGGER PENDING until the trigger is hit.
  • RED
    Hi @sujith

    Continuation to the above query :
    If I cancel an executed CO order with status = "trigger pending" , I get two postback requests with status = "CANCELLED".

    The only difference in the two requests is with the "pending_quantity" field, whose sequence is unpredictable. (Sometimes I get request with pending order first and later get the one without pending order later and vice versa).

    One has suggested to implement two websocket connections, as this issue happens with load on the threading to process tick data; of the two websocket connections, one is to handle the data_fetch and order placement, other to monitor postback requests and misc activities. Is this a good practice?

    I am open to all suggestions.

    Thanks in advance.
  • RED
    Query 2:
    Say, if in my CO order(quantity = 100), 45 quantity gets executed and 55 is pending.

    If trigger is executed/ cancelled, may I have a picture of what will the postback fields on quantities look like.(quantity, filled_quantity, pending quantity, cancelled_quantity).
  • rakeshr
    One has suggested to implement two websocket connections, as this issue happens with load on the threading to process tick data; of the two websocket connections, one is to handle the data_fetch and order placement, other to monitor postback requests and misc activities. Is this a good practice?
    Mis-match in order update sequence can be either because of the async nature of order update broadcast or your local tick processing block. You can try implementing two Websocket and test the same or maybe you can add a little buffer period, before performing any computation based on these async order updates. This thread gives more insight.

    if in my CO order(quantity = 100), 45 quantity gets executed and 55 is pending. If trigger is executed/ cancelled, may I have a picture of what will the postback fields on quantities look like.(quantity, filled_quantity, pending quantity, cancelled_quantity).
    An UPDATE postback is triggered when an open order is modified or when there's a partial fill. So, you will receive two order update status, one UPDATE for partial fill and the second for left cancel/completed.
Sign In or Register to comment.