unable to modify trigger_price in a cover order by using kite.modify_order() method

jvshk78trade
hi,
i'm unable to modify trigger_price in a cover order by using kite.modify_order() method, does the stop loss order have a different order_id, pl explain.
  • sujith
    Can you let us know what is the error message you are getting?
  • jvshk78trade
    my code looks like this:

    placing CO order(SUCCESSFUL):

    c1.order_id_sell = kite.place_order(variety='CO', tradingsymbol=c1.tradingsymbol, exchange=kite.EXCHANGE_MCX,transaction_type = kite.TRANSACTION_TYPE_SELL, quantity = 1,order_type = kite.ORDER_TYPE_MARKET, product = kite.PRODUCT_CO,trigger_price = 4255)

    output seen on on terminal(google cloud shell):

    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /orders/CO HTTP/1.1" 307 0
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /orders/co HTTP/1.1" 200 58

    placing stop loss trigger price modify order(UNSUCCUSFUL):

    kite.modify_order(variety='CO',order_id=c1.order_id_sell,trigger_price=4265)

    output seen on on terminal(google cloud shell):

    DEBUG:urllib3.connectionpool:Resetting dropped connection: api.kite.trade
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "PUT /orders/CO/180327001820503 HTTP/1.1" 307 0
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "PUT /orders/co/180327001820503 HTTP/1.1" 200 58
    '180327001820503

    Trigger Price in pending SL order dosent change
  • sujith
    sujith edited March 2018
    You can't modify the trigger price of first leg order(LIMIT type) after placing a cover order. You can only modify trigger price of second leg order.
    A similar javakiteconnect example for modifying second leg SL-M order is here.
    You can use this as the reference.
    The keynote is to send order_id, parent_order_id and variety as co (lower case).
  • jvshk78trade
    more confusion:
    pl describe order_id and parent_order_id, how to get them?

    after successfully placing cover order i'm getting an number which i assume is order_id

  • sujith
    The first leg order is called parent order and when modifying a second leg order you need to send the order id for which you want to modify trigger price and send parent order id along with it.
    You can check out more details here.
  • jvshk78trade
    Thanks, its clear now.
This discussion has been closed.