Is Kite Connect Historical API provides Exchange Snapshot Data

baruns
I just want to know about the Kite Connect API which provides Historical API (Addon), does it provide Exchange 1 minute / 2 minute / 5 minute snapshot / delayed data directly or it generates candle from tick by tick data at their end and provide them as historical data.

Please let me know the same.
  • rakeshr
    Historical candle APIs gives historical candle data of different interval(1min,5min,etc). You can have look at this documentation.
  • baruns
    @rakeshr Thanks for the reply. I know that it gives historical candle data of different intervals. But we can generate historical candle data at our end with the help of tick by tick data received from Kite Connect API. Here comes the problem.

    If we generate candle at our end, it will not match exactly with the one we see on Zerodha charts. This is because Zerodha uses Exchange snapshot data on charts. You can see same chart in Zerodha as well as Upstox as well as Fyers as they all use snapshot data provided by Exchange for charts. However, TradingView will show different chart as they generate candle at their end using Tick Data from Exchange.

    Now my question is whether the Historical API provides the same snapshot data that is visible on Zerodha charts / which is exactly going to be matched with Zerodha charts?
  • rakeshr
    This is because Zerodha uses Exchange snapshot data on charts.
    The exchange bhav-copy sync is done at end of the day, not live. You can go through this article to know about this.
    Now my question is whether the Historical API provides the same snapshot data that is visible on Zerodha charts / which is exactly going to be matched with Zerodha charts?
    Yes, the source remains same for both Web and APIs. In both conditions of the live candle formation or bhav-copy sync at EOD.
    But, we don't recommend polling Historical data APIs during live candle formation for reasons stated in this and this threads.
  • baruns
    @rakeshr I guess I'm still not able to make you understand the doubt I'm having. Let me explain you in detail.

    Exchange bhav-copy provide daily candle data. My doubt is on intraday candle data. Let's take the example of HCLTECH 1 minute chart.

    I've active subscription of Kite Connect API. I listened to all ticks received for HCLTECH yesterday and I created 1 min candle based on the tick for HCLTECH. Then I found that somewhere candle close and somewhere candle open has not matched with Zerodha HCLTECH 1 minute chart with the one I generated at my end. Then I searched and found that Zerodha intraday chart uses NSE 1 minute snapshot data and for that reason 1 minute chart data shown on Zerodha chart will never match 100% with the one I'm generating at my end. I guess @sujith only wrote this in some other topic. Then I compared zerodha charts with Upstox and Fyers and found that intraday charts are exactly same for all of them. It means they all are using exchange 1 minute snapshot data on their charts. Now my 1 minute candle data will not match with them because I'm not using NSE 1 minute snapshot data, instead I'm creating candle at my end using Tick Data. The same applies for TradingView also. Their intraday chart is different than Zerodha / Upstox / Fyers as they also generate candle at their end.

    Now my question is if I subscribe to the Historical API, will I get NSE snapshot data when I will fetch 1 minute data for a stock or I will get different data (Zerodha may create 1 minute candle with tick by tick data at their end and provide to API users)?
  • sujith
    @baruns,
    We also make candles using the tick data that we receive just like you did. But the setup we use is different, hence it may not match 100% but the basic idea is to capture the trend.
    You can refer to this thread to get more clarity.
  • baruns
    @sujith I've seen the thread earlier also that you have referenced. I can understand that candle generated by tick data cannot be matched 100%.

    So if I subscribe to Historical Data, will it provide exactly same 1 minute data that is visible on Zerodha charts?
  • sujith
    Yes, you will get but we strongly recommend not to use it for live strategies. It is provided only for backtesting purposes only.
    For live strategies, we suggest you generate candles at your end. Just like how you tested right now.
    Try setting up things on the cloud, maybe the values will be nearer.
  • baruns
    @sujith Thanks for the reply. Yes I also don't like to fetch historical data for live strategies. But I've seen strategies that uses indicators which does critical math to give output, generally fails when data is slightly different too..

    I've seen that in few cases, we can see huge profit in manual backtesting derived from zerodha charts, whereas, on the other hand, same gives losses when applied on candle generated using Tick Data.

    Anyways, thanks..
Sign In or Register to comment.