Delay in quote() API

amrendu
Hi,

From last few days, i am facing a delay in quote() api call.

The delay is huge (~8 seconds)

Kindly check and fix the issue asap.

Code :

api_key = "mapikey"
api_secret = "myapisec"
kite = KiteConnect(api_key)

access_token = "myacctok"
kite.set_access_token(access_token)

print("before kite.quote() call : {}".format(datetime.now()))
print(kite.quote("NFO:BEL20JUL108CE"))
print("After kite.quote() call : {}".format(datetime.now()))

Output :

before kite.quote() call : 2020-07-07 12:01:08.769655

{'NFO:BEL20JUL108CE': {'instrument_token': 16259586, 'timestamp': datetime.datetime(2020, 7, 7, 12, 1, 7), 'last_trade_time': datetime.datetime(2020, 7, 7, 11, 14, 50), 'last_price': 2.85, 'last_quantity': 15200, 'buy_quantity': 684000, 'sell_quantity': 600400, 'volume': 380000, 'average_price': 3.11, 'oi': 182400, 'oi_day_high': 235600, 'oi_day_low': 174800, 'net_change': 0, 'lower_circuit_limit': 0.05, 'upper_circuit_limit': 9.65, 'ohlc': {'open': 2.3, 'high': 3.5, 'low': 2.3, 'close': 3.2}, 'depth': {'buy': [{'price': 3.15, 'quantity': 7600, 'orders': 1}, {'price': 3.05, 'quantity': 15200, 'orders': 2}, {'price': 2.95, 'quantity': 76000, 'orders': 5}, {'price': 2.9, 'quantity': 38000, 'orders': 2}, {'price': 2.85, 'quantity': 7600, 'orders': 1}], 'sell': [{'price': 3.25, 'quantity': 7600, 'orders': 1}, {'price': 3.3, 'quantity': 22800, 'orders': 2}, {'price': 3.5, 'quantity': 106400, 'orders': 7}, {'price': 3.6, 'quantity': 83600, 'orders': 4}, {'price': 3.9, 'quantity': 7600, 'orders': 1}]}}}

After kite.quote() call : 2020-07-07 12:01:15.405168
  • amrendu
    Dear Zerodha, @sujith ,
    Kindly look into this
  • sujith
    @amrendu,
    Is this consistent or intermittent? Can you let us know more about your setup? Can you let us know about the os, library version, and network details as well? From how long do you observe this issue?
  • amrendu
    Hi @sujith This is intermittent issue.
    OS : windows 10
    kiteconnect version : 3.8.2
    Stable ACT network 150 MBPS speed

    from yesterday it is consistent ( before it was random intermittent)
  • amrendu
    Hi @sujith Today again i am seeing delay in quote api call , please resolve this as i do i high frequency trade and any delay costs huge to me

    Delay now is almost 15 seconds
    before kite.quote() call : 2020-08-04 10:30:44.657421

    {'NFO:BEL20AUG108CE': {'instrument_token': 16260098, 'timestamp': datetime.datetime(2020, 8, 4, 10, 30, 55), 'last_trade_time': datetime.datetime(2020, 7, 30, 12, 10, 4), 'last_price': 1.5, 'last_quantity': 7600, 'buy_quantity': 167200, 'sell_quantity': 334400, 'volume': 0, 'average_price': 0, 'oi': 7600, 'oi_day_high': 7600, 'oi_day_low': 7600, 'net_change': 0, 'lower_circuit_limit': 0.05, 'upper_circuit_limit': 5.45, 'ohlc': {'open': 0, 'high': 0, 'low': 0, 'close': 2.25}, 'depth': {'buy': [{'price': 1.65, 'quantity': 7600, 'orders': 1}, {'price': 1.6, 'quantity': 45600, 'orders': 3}, {'price': 1.55, 'quantity': 76000, 'orders': 5}, {'price': 1.45, 'quantity': 15200, 'orders': 1}, {'price': 1.25, 'quantity': 7600, 'orders': 1}], 'sell': [{'price': 1.85, 'quantity': 15200, 'orders': 2}, {'price': 1.9, 'quantity': 7600, 'orders': 1}, {'price': 2.05, 'quantity': 121600, 'orders': 8}, {'price': 2.55, 'quantity': 15200, 'orders': 1}, {'price': 3.65, 'quantity': 174800, 'orders': 1}]}}}

    After kite.quote() call : 2020-08-04 10:31:00.301679
  • sujith
    @amrendu,
    I am getting the response within 300ms. Can you check with some other network?
  • amrendu
    amrendu edited August 2020
    Hi @sujith

    Today i observed the issue is not with quote api call , but it is independent of any call
    The issue is intermittent at random interval and subsequent calls are fine.
    Meaning if there is no api calls made for some time (8-10mins) , the first api call after that has delays (~5-10seconds) and immediate api calls after that is fine without any delay

    Also the issue is independent of network i checked with different networks.
Sign In or Register to comment.