Order Failure but Placed Actually

prakash.jj
Hi,

I got this error while placing the Order but the order was actually placed.

HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)

I had the retry mechanism which resulted in triggering multiple orders.

How to handle this scenario
  • sujith
    You can refer to this thread.
  • prakash.jj
    Hi @sujith , I went through that but still not clear how to handle this. Because it doesn't return the Order Id, so cant ensure that the order which I fired is actually placed or not.
  • prakash.jj
    I am actually running 2 algos and cant really check the Order History and find out the order exists for that symbol as sometimes for the same symbol the order might be fired from both the algos
  • sujith
    You can use order tags and check.
  • prakash.jj
    @sujith I have started coding the retry mechanism. Just want to be sure I am doing it right. Can I assume that if I fetch the order history after the order failed with this timeout error, the order will be available within the next second? or Do I need to wait for a certain seconds before fetching the orders?
  • rakeshr
    Do I need to wait for a certain seconds before fetching the orders?
    Though orderbook is instantly updated. But for some foreseen exceptions, better you can add some buffer wait time i.e maybe a few seconds.
  • prakash.jj
    Sure thank you @rakeshr . Have added 10 secs intervals of 3 iterations. So totally 30 secs. Hope that's more than enough for the orderbook to reflect.
  • KamalChhirang
    @prakash.jj I got the same error before few days, and order was placed after 32 seconds, so I am currently keeping a time of 60 seconds.


    Last time, I placed so many unwanted orders, and took unwanted leverage because of this, be careful.
Sign In or Register to comment.