yfinance icon indicating copy to clipboard operation
yfinance copied to clipboard

0 volume reported for 1st hour in the day in hourly OHLC data from yfinance (indian NSE exchange)

Open pranay2612 opened this issue 4 years ago • 2 comments

I am using yfinance to get the stock data for Indian markets (.NS). When i fetch the hourly data, I can see that the volume reported for the first hour of trade in the day is zero. For ex:

import yfinance as yf df = yf.download(tickers='RELIANCE.NS', period='15h', interval='1h')

Running the above snippet gives the volume data as:

                         Adj Close   Volume  

2021-08-05 12:15:00+05:30 2142.550049 0
2021-08-05 13:15:00+05:30 2139.050049 1587356
2021-08-05 14:15:00+05:30 2131.800049 1022093
2021-08-05 15:15:00+05:30 2131.000000 390904
2021-08-06 09:15:00+05:30 2138.100098 0
2021-08-06 10:15:00+05:30 2093.250000 2521007
2021-08-06 11:15:00+05:30 2091.449951 1384997
2021-08-06 12:15:00+05:30 2091.699951 495260
2021-08-06 13:15:00+05:30 2089.250000 519644
2021-08-06 14:15:00+05:30 2088.899902 900637
2021-08-06 15:15:00+05:30 2090.500000 622952
2021-08-09 09:15:00+05:30 2077.100098 0
2021-08-09 10:15:00+05:30 2075.800049 284283
2021-08-09 11:15:00+05:30 2073.050049 492477
2021-08-09 12:15:00+05:30 2073.500000 650123
2021-08-09 13:15:00+05:30 2072.000000 408989
2021-08-09 14:15:00+05:30 2075.699951 450642
2021-08-09 15:15:00+05:30 2078.500000 260898

Please fix this or tell me if there is a way to get this data correctly.

Also, the BSE exchange (RELIANCE.BO) is able to report the correct volume for all hours. But the NSE exchange (RELIANCE.NS) has this issue.

pranay2612 avatar Aug 09 '21 19:08 pranay2612

Please let me know if there is a way to correct this.

pranay2612 avatar Aug 10 '21 11:08 pranay2612

This is caused by Yahoo, they think 0 volume occurred in that first hour. E.g. look at their interactive chart with hour candles.

ValueRaider avatar Aug 15 '22 16:08 ValueRaider