OMS connection error

sabyasm
sabyasm edited June 2016 in General
Hello Kite Team/ @Kailash !

For the past couple of days I am seeing a lot of 'OMS connection error' happening while placing an order or modifying an order. I am using Amazon AWS infrastructure - so there shouldn't be much n/w latency between my api call.

1. Do you have a log to analyze how many api calls are facing this 'OMS connection error' issue? And can you investigate?
2. Could you please explain me what can be the possible cause and how to avoid this?

To give you an idea - my application runs for python api (latest version) and I face this issue intermittently when placing around 5-10+ orders in succession. When I place 2-3 orders, I have never faced this issue.

Here is the code snippet for modifying orders


for index, row in dfnew.iterrows():
try:
o = kite.order_modify(order_id=str(int(row['order_id'])),parent_order_id=None,trigger_price=row['sl_price_new'], variety='co' )
print str(int(row['order_id'])) + ' has been modified successfully.'
except Exception as e:
print (str(int(row['order_id'])), str(e))
#raise



code snippet for placing CO


for index, row in orderlist.iterrows():
#find the last price
ltp = kite.quote(exchange="NSE",tradingsymbol=row['symbol'])
sl_price = myround(ltp['last_price'])
#now place orders
try:
order_id = kite.order_place(
tradingsymbol=row['symbol'],
exchange="NSE",
quantity= row['qty'],
transaction_type="SELL",
order_type="MARKET",
product="CO",
trigger_price = sl_price,
variety="co"
)
print 'placing order for ' + str(row['qty']) + ' ' + row['symbol'] + ' @' + str(ltp['last_price']) + ' with sl @' + str(sl_price) + ' : ' + kite.orders(order_id=str(order_id))[0]['status']
except Exception as e:
print ("placing order failed : ", str(e))
data = pd.DataFrame({"symbol" : row['symbol'] , "qty" : row['qty']/exec_count},index=[0])
dfailed = dfailed.append(data)
#raise


Here is an outcome:

placing order for 229 APOLLOTYRE @151.35 with sl @152.55 : COMPLETE
placing order for 80 DLF @145.4 with sl @146.55 : COMPLETE
('placing order failed : ', 'OMS timed out')
placing order for 26 TATAMOTORS @447.4 with sl @451.0 : COMPLETE
  • Kailash
    @sabyasm Can you share the timestamps of the failed calls?
  • sabyasm
    @Kailash - I will add exact timestamp for next executions. However, these errors happened somewhere between 9:50-9:51 and few happened around 10:04-10:05 on 29th June.
  • sabyasm
    @Kailash,

    Other than OMS Timed out I have encountered several other errors today. Surprisingly - the same order executed couple of seconds before through the same code.



    Please see that the same order for SBI was successfull at 9:49:58 but failed at 9:51:33.

    The order placement is done via same code.
  • virtualKG
    @Kailash - Facing "Gateway Timed Out" Error - but the order is getting placed and is visible in Kite.

    Executed Code:

    order_id = kite.order_place(exchange="NFO",tradingsymbol="BANKNIFTY16JUNFUT",transaction_type="BUY",quantity=30,price=17000,product="BO",order_type="LIMIT",validity="DAY", variety="bo", stoploss_value=170, squareoff_value=340)

    Output:

    Traceback (most recent call last):
    File "", line 1, in
    File "C:\Python27\lib\site-packages\kiteconnect\__init__.py", line 264, in order_place
    return self._post("orders.place", params)["order_id"]
    File "C:\Python27\lib\site-packages\kiteconnect\__init__.py", line 443, in _post
    return self._request(route, "POST", params)
    File "C:\Python27\lib\site-packages\kiteconnect\__init__.py", line 495, in _request
    raise ex.ClientNetworkException("Gateway timed out", code=504)
    kiteconnect.exceptions.ClientNetworkException: Gateway timed out

    It was working perfectly fine earlier today.
  • Vivek
    @virtualKG Today we had issues with our OMS vendor Thomson Reuters, we are speaking with them.
  • virtualKG
    @Vivek - Please post an update once resolved. Thanks.
  • sabyasm
    @vivek ,

    "OMS connection error" and "Gateway timed out" -- are they both related to OMS vendor? While the first error prevents any order through the second error actually lets the order put into the system which is extremely risky behavior.

  • sabyasm
    @vivek @Kailash

    Again getting OMS Connection Error starting from 10:04.



Sign In or Register to comment.