history data using Get("market.historical", param) method is not accurate.

I have written code using Get("market.historical", param) method. I'm trying to get a 5-minute candle on the live market but observed not getting accurate data of OHLC Volume. I have tried to do it with a 5min/ 15min/ 30min/ 45min / 1 hr delay, however, I'm seeing data discrepancy between Zerodha Live chart vs downloaded data by API.

Is there anyway to get accurate data from API?
  • sujith
    The historical data API is provided only for backtesting purposes. You can use live market data from websockets to build the candle data. You can get started here.
  • hrp
    Thanks, Sujith for your reply. WebSocket is getting disconnected sometimes so it's quite challenging. I will try to implement websockets. Do you think, can get volume qty accurately?

    Assuming, I need to sum up all the volume figures (received on each ticks), while aggregating data to prepare 5-minute candles?

  • sujith
    The volume data on live market stream is a cumulative value. You will need to subtract the last tick and first tick volume to get current minute's volume.
  • hrp
    Thank you for clarification :)
This discussion has been closed.