Couldn't find that `order_id

Pijus

While placing order through kite_connect_API with Python, During first 2/3 minutes of the day while the order is sent we are getting an exception in most of the times 'Couldn't find that `order_id`. Immediately we can find a trade BUY or SELL in the Kite terminal and that is lying abundant and further action like Exit with Profit or SL not hitting and not following any instructions further. Finally we are squaring it off manually.

--We have written the following Python code, sending it for your reference

oid = kite.place_order(tradingsymbol=comp[2],
exchange=comp[5],
transaction_type=comp[1],
quantity=lots,
order_type=comp[3],
product=comp[4], variety = "regular")
#print("Time after receiving order Id", datetime.now())
print ("Order Id : ", oid)
hist = ''
hist = kite.order_history(order_id = oid)
  • rakeshr
    @Pijus
    It is possible that there is a delay because at the opening we fire the AMOs also which will be in tens of thousands and the message queue at the exchange lines also peak at these times. We are constantly working on this to bring this down to the minimum with the OMS team and by increasing lease lines and many other alternatives.

    Also, you can try an alternative to add sleep for sometime and then fetch the complete order book and check the same.
  • saurabh3679
    I had similar problem. I solved it in following manner:
    while True:
    try:
    oid = kite.place_order( details of order here )
    except Exception as e:
    logging.critical(e)
    else:
    break
    it will keep trying to place the order until succeed
  • saurabh3679
    not necessary to log the exception in the example above
  • Vaga
    Even I am facing similar issue especially during opening hours or when there is volume spikes (say crude when US market opens). The orders get executed but we don't immediately get the order id.
Sign In or Register to comment.