kite.quote api: "change_percent" and "change" field missing from the response

naz
@zartimus @sujith
I am trying a simple command " kite.quote('NSE:BAJFINANCE') " and below is the response I am getting

{'NSE:BAJFINANCE': {'average_price': 1868.16,
'buy_quantity': 0,
'depth': {'buy': [{'orders': 0, 'price': 0, 'quantity': 0},
{'orders': 0, 'price': 0, 'quantity': 0},
{'orders': 0, 'price': 0, 'quantity': 0},
{'orders': 0, 'price': 0, 'quantity': 0},
{'orders': 0, 'price': 0, 'quantity': 0}],
'sell': [{'orders': 3, 'price': 1880.4, 'quantity': 369},
{'orders': 0, 'price': 0, 'quantity': 0},
{'orders': 0, 'price': 0, 'quantity': 0},
{'orders': 0, 'price': 0, 'quantity': 0},
{'orders': 0, 'price': 0, 'quantity': 0}]},
'instrument_token': 81153,
'last_price': 1880.4,
'last_quantity': 1,
'last_trade_time': datetime.datetime(2018, 4, 20, 15, 55, 56),
'net_change': -32.900024,
'ohlc': {'close': 1913.3, 'high': 1907.8, 'low': 1850.15, 'open': 1907.8},
'oi': 0,
'oi_day_high': 0,
'oi_day_low': 0,
'sell_quantity': 369,
'timestamp': datetime.datetime(2018, 4, 20, 15, 58, 14),
'volume': 1226196}}

I can't locate "change_percent" and "change" as per https://kite.trade/docs/connect/v3/market-quotes/ (although there is field 'net_change')
I am not sure if I am missing something here.
Please advise.
Tagged:
  • naz
    @sujith
    Any update on the above ?
  • sujith
    Hi,
    The getQuote API will return absolute change only. You can calculate change_percent as follows,
    change percent = ((lastTradedPrice - closePrice) * 100) / closePrice
  • naz
    Thanks @sujith . Also, just to confirm, this means the documentation is not updated for this API (please check "Response attributes" section of https://kite.trade/docs/connect/v3/market-quotes/). Because this section specifies both 'change_percent' and 'change' as the response attributes of getquote API.
    Wanted to understand the same to ensure that I am looking at the correct/updated documentation.
  • sujith
    Thank you for pointing out. We will update documentation.
Sign In or Register to comment.