Regarding kite historical api delay

visasimbu
I want to 1 hour candle once it is closed. lets say i want 09:15am , 10:15am and so on. This candle will complete on the next minute.

09:15 candle will get complete only when 09:16AM.
10:15AM candle complete only when 10:16AM
11:15AM candle complete only when 11:16AM
12:15AM candle complete only when 12:16AM
01:15PM candle complete only when 01:16 PM
02:15PM candle complete only when 02:16 PM
03:15PM candle complete only when 03:16 PM

so i want this 1 hour candle data. Whether this should be fetched from historical api as like below.

end_date = pd.Timestamp.now(tz="Asia/Kolkata").normalize()
from_date = end_date - timedelta(days=120)

historical = self.kite.historical_data(
instrument_token=self.instrument_token,
from_date=from_date,
to_date=end_date,
interval="60minute"
)

or can i monitor every tick and calculate the ohlc by myself in proram.. i believe this approach will be error prone. Since i might not get all the ticks from broker.. and this will be overhead my system.

if i relay on historical api, will i get 1 hour candle data of 10:15AM at 10:16AM ? or at latest when will i receive 10:15AM closed one hour candle ?
  • Sravanthi_bh
    You may consume live ticks and form candles, Refer to the FAQs for more help.
  • visasimbu
    @Sravanthi_bh -
    I feel tick data is not ideal due to below reasons.
    Option 1 : Using tick data
    Why NOT ideal:
    1) Tick data is not guaranteed to be complete. Brokers like Zerodha send only relevant price updates.
    2) I won’t receive all trades, especially for illiquid options or deep OTM strikes.
    3) Overhead: I will need to manage candle state, time alignment, rollovers, and edge conditions (like no tick near 10:15).

    Option 2 : Use Zerodha’s historical_data() API with interval="60minute"
    Why Ideal
    1) Zerodha's API already provides 1-hour aggregated OHLC data.
    2) Candles are time-aligned to 15th minute, e.g.:
    3) Candle labeled 10:15 means: 09:15 → 10:15 interval.
    That candle will typically be available by 10:16:00 – 10:17:00, depending on their backend batch process latency

    Here I have one question how quick or how much delay i will observe when i call historical api for the 1 hour candle which just got closed ? For example now time is 11:16AM i was looking for 10:15AM to 11:15AM 1 hour time candle from historical API. Approximately when will i receive this data via historical api ?
  • sujith
    @visasimbu,
    You may check out our stance on this here.
  • Sravanthi_bh
    You may check out the similar discussion here.
Sign In or Register to comment.