Returning wrong pending orders and time out exceptions.

suraj
I have developed an ATS(automated trading system) using kitepyconnect. My ATS queries for open orders every minute. What I noticed is that the API sends me wrong open orders sometimes. At 10:53 When my system queried the pending order there were 2 pending orders in the system and API returned the same 2 pending orders. @10:54 when my ATS queried open orders there were 2 pending orders in the system but it returned zero len list [].

Also, My ATS is encountering Gateway time out exceptions very often once in 20mins this exception comes. My system had also caught another exception saying 'OMS timed out' I don't know why is this? I reported the same problem of gateway timed out yesterday.

The way we have coded our ATS is like this. We have 2 programs both of them shares single access token. We create an access token and use it for the whole day. Every minute our code requests for pending orders and executed orders. Based on executed and pending orders our ATS places an order or modifies the order.

These are the User IDs RA6252 RK2784 using which I faced these problems.
  • Vivek
    @suraj We are investigating the orderbook getting empty issue/. Regarding OMS timeout issue we will be speaking with our OMS vendor.
  • suraj
    suraj edited May 2016
    @vivek , Same thing can happen with executed orders? Can trades() return []?
  • suraj
    suraj edited May 2016
    @vivek My ATS recived gateway timed out exception 3 times post 11:00 am. Also there's a new Exception my system caught which says 'Invalid response from OMS' I caught this exception while modifing an order.
  • suraj
    @vivek My system is catching too many exceptions. From 09 : 30 it had caught like more than 70 exceptions. Common exceptions were 'Unknown Content-Type in response','OMS timed out','gateway timed out','invalid response' . I update my pykiteconnect but still these exceptions are coming. Can you please let me know why are these exceptions coming? Also I think empty orderbook is still not been resolved I am still getting empty orderbook when there are pending orders in the system.

    One strange thing happened. My ATS requested for open orders @12:48 and the API returned me open orders. Using the same access token my ATS requested for open order @12:49 and the api sent me an exception saying Invalid token. very next minute i.e @ 12:50 ATS requested for open orders and the API returned me open orders.
  • suraj
    @vivek My system is catching too many exceptions. From 09 : 30 it had caught like more than 70 exceptions. Common exceptions were 'Unknown Content-Type in response','OMS timed out','gateway timed out','invalid response' . I update my pykiteconnect but still these exceptions are coming. Can you please let me know why are these exceptions coming? Also I think empty orderbook is still not been resolved I am still getting empty orderbook when there are pending orders in the system.

    One strange thing happened. My ATS requested for open orders @12:48 and the API returned me open orders. Using the same access token my ATS requested for open order @12:49 and the api sent me an exception saying Invalid token. very next minute i.e @ 12:50 ATS requested for open orders and the API returned me open orders.
  • Kailash
    @suraj Are you using the Python API client?
  • Kailash
    @suraj And the library version at your end is 3.1.1?
  • suraj
    No I think it is 3.0
  • Vivek
    @suraj we have released major patches on version 3.1. Please test it and let us know
  • suraj
    Thanks @vivkek I have updated the library.
This discussion has been closed.