What could be the reason behind data missmatch when doing query for hourly and daily?

pavanvora
I see that the data which comes from Zerodha API is mismatching when I try to fetch historical data hourly and daily.
Here's the instrument for which I tried querying Historical data, tradingsymbol: SBICARD, exchange: BSE.

The Parameters are
instrument_token: 139024900,
Interval: 'day',
from_date: 2020-08-31T18:30:00.000Z,
to_date: 2020-09-02T18:29:59.999Z.

And the result was
[
{
date: 2020-08-31T18:30:00.000Z,
open: 801.05,
high: 820.15,
low: 797.1,
close: 805.65,
volume: 70255
}
]
Now when I try to query the same instrument_token for the same time range but for different interval ('hour') value the response I get is
[
{
date: 2020-09-01T03:45:00.000Z,
open: 801.05,
high: 820.15,
low: 797.15,
close: 812.65,
volume: 28593
},
{
date: 2020-09-01T04:45:00.000Z,
open: 812.65,
high: 813.9,
low: 807.7,
close: 809.45,
volume: 6799
},
{
date: 2020-09-01T05:45:00.000Z,
open: 809.45,
high: 810.95,
low: 805,
close: 809.6,
volume: 5756
},
{
date: 2020-09-01T06:45:00.000Z,
open: 809.6,
high: 811,
low: 804.75,
close: 809.45,
volume: 5835
},
{
date: 2020-09-01T07:45:00.000Z,
open: 809.45,
high: 811.85,
low: 805.8,
close: 807.55,
volume: 7009
},
{
date: 2020-09-01T08:45:00.000Z,
open: 807.55,
high: 812.35,
low: 803.95,
close: 806.05,
volume: 10430
},
{
date: 2020-09-01T09:45:00.000Z,
open: 806.05,
high: 806.05,
low: 802,
close: 805.15,
volume: 5066
}
]
Now if I sum up the volume of each hour as below
28593 + 6799 + 5756 + 5835 + 7009 + 10430 + 5066 = 69488 (Total Volume)
So if I do sum up 1 day of hourly volume it is 69488 and if I fetch the same day data from Zerodha with interval as 'day' I get 70255.

What could be causing this diff of 70255 - 69488 = 767 (volume) ?

Anyone's help will be really very very helpful.
  • sujith
    The day candle data is fetched from the BHAV copy, it involves data of post-market session as well.
    The hourly candles are generated using the live market data that is streamed during the market hours by the exchange.
Sign In or Register to comment.