last_price from ohlc and ltp methods is not matching the zerodha web application values

amitjet

I am getting some unexpected data in python code

e.g. for symbol = NIFTY 12th DEC 24800 CE

symbolToken = '11809538'
sym_data = kite.ohlc(symbolToken)
sym_df = pd.DataFrame(sym_data)
print(f"{datetime.datetime.now().strftime('%H:%M:%S')} DEBUG:{symbolToken}{sym_data}:{round(sym_df.iloc[1][0],2)}")

gave following output

11:07:30: DEBUG:11809538{'11809538': {'instrument_token': 11809538, 'last_price': 174.65, 'ohlc': {'open': 162.95, 'high': 214.9, 'low': 129.8, 'close': 163.95}}}:174.65
11:07:34: DEBUG:11809538{'11809538': {'instrument_token': 11809538, 'last_price': 160.3, 'ohlc': {'open': 162.95, 'high': 214.9, 'low': 129.8, 'close': 163.95}}}:160.3
11:07:36: DEBUG:11809538{'11809538': {'instrument_token': 11809538, 'last_price': 176.9, 'ohlc': {'open': 162.95, 'high': 214.9, 'low': 129.8, 'close': 163.95}}}:176.9
11:07:38: DEBUG:11809538{'11809538': {'instrument_token': 11809538, 'last_price': 177.15, 'ohlc': {'open': 162.95, 'high': 214.9, 'low': 129.8, 'close': 163.95}}}:177.15
11:07:41: DEBUG:11809538{'11809538': {'instrument_token': 11809538, 'last_price': 161, 'ohlc': {'open': 162.95, 'high': 214.9, 'low': 129.8, 'close': 163.95}}}:161
11:07:43: DEBUG:11809538{'11809538': {'instrument_token': 11809538, 'last_price': 163.45, 'ohlc': {'open': 162.95, 'high': 214.9, 'low': 129.8, 'close': 163.95}}}:163.45
11:07:45: DEBUG:11809538{'11809538': {'instrument_token': 11809538, 'last_price': 176.65, 'ohlc': {'open': 162.95, 'high': 214.9, 'low': 129.8, 'close': 163.95}}}:176.65
11:07:47: DEBUG:11809538{'11809538': {'instrument_token': 11809538, 'last_price': 176.75, 'ohlc': {'open': 162.95, 'high': 214.9, 'low': 129.8, 'close': 163.95}}}:176.75
11:07:49: DEBUG:11809538{'11809538': {'instrument_token': 11809538, 'last_price': 174.9, 'ohlc': {'open': 162.95, 'high': 214.9, 'low': 129.8, 'close': 163.95}}}:174.9


if you see at 11:07:41, we got last_price as 161. however, if you go to kite website, the 1 min candle had a low of 170.05.

so how the ohlc api reported the last_price as 161 ?



This discussion has been closed.