Hi. I generaly use the tick: KiteTick to get the OHLCV values for the instrument. The issue is that compared to chart, the values are not always correct. This happens randomly and for some symbols it mathces, and for some it does not match. for example, for TCS today,2025-09-18, at 9:18 after the first 3 min candle formed, my code logger the values for OHLC as following: 09:18:01 - NSE.TCS - INFO - is_new_candle - New Candle for 3minute for TCS at 2025-09-18 09:18:00 09:18:01 - NSE.TCS - INFO - myfunc - TCS Volume 125605 09:18:01 - NSE.TCS - INFO - myfunc - TCS Tick Based OHLC High 3193.8 09:18:01 - NSE.TCS - INFO - myfunc - TCS Tick Based OHLC Low 3185.0 09:18:01 - NSE.TCS - INFO - myfunc - TCS Tick Based OHLC Open 3185.0 09:18:01 - NSE.TCS - INFO - myfunc - TCS Tick Based OHLC Close 3172.8 09:18:01 - NSE.TCS - INFO - myfunc - TCS Days First Candle Volume 30000
here the Close value is wrong 3172.8. Infact TCS never touched 3172 in first 30 mins today after gap open around 3185. On chart this value is 3185. I have other examples too. Please check this. This happens randomly with high value as well. But for close value, the issue is pretty consistent.
Why I use this? I need the day level OHLC values and I dont want to use historical API as i work with 100s of symbols.
code: in my ticker handle/processor: def __init__(self, tick_data: Dict[str, Any]): self.instrument_token = tick_data.get("instrument_token") self.last_price = tick_data.get("last_price") self.volume = tick_data.get("volume_traded", 0) # Default to 0 for volume self.ohlc = tick_data.get("ohlc", {})
def on_tick(self, tick: KiteTick) -> None: tick_day_high = tick.ohlc.get('high', None) if tick.ohlc else None #use only for basic.its not very accurate tick_day_low = tick.ohlc.get('low', None) if tick.ohlc else None #use only for basic.its not very accurate tick_day_open = tick.ohlc.get('open', None) if tick.ohlc else None #use only for basic.its not very accurate tick_day_close = tick.ohlc.get('close', None) if tick.ohlc else None #use only for basic.its not very accurate logger.info(f"Tick Based OHLC High {tick_day_high}") logger.info(f" Tick Based OHLC Low {tick_day_low}") logger.info(f"Tick Based OHLC Open {tick_day_open}") logger.info(f"Tick Based OHLC Close {tick_day_close}")