ranaroussi / yfinance

Download market data from Yahoo! Finance's API
https://aroussi.com/post/python-yahoo-finance
Apache License 2.0
14.68k stars 2.43k forks source link

Daily OHLC rows missing randomly #689

Open olearyw opened 3 years ago

olearyw commented 3 years ago

Recently I've noticed that some rows of the daily OHLC data is missing. However these dates are not missing on the yahoo finance site. As you can see from the below image the 13th - 20th April is missing.

image

Does anyone have a solution for this? I have the latest versions of yfinance.

arcane-p commented 3 years ago

Getting the same error, seems to be entire days of data unavailable. When individually running .history the stock has data for that day, so maybe Yahoo is limiting something?

olearyw commented 3 years ago

I think they are, when I load the data on my phone, the data isn't missing which makes me think yahoo has flagged my computer and limited the data. Is there anyway around this?

stevenwong commented 3 years ago

Getting the same error, but if Yahoo is flagging your PC, it shouldn't be randomly missing dates and subsequent/individual .history() shouldn't work?

Seems to only happen when I put it in a loop and mass download, and only for a specific date range (26/04 to 29/04) at the time of writing.

stevenwong commented 3 years ago

It seems to work if I download history one by one. So either Yahoo or YFinance doesn't like multiprocessing?

olearyw commented 3 years ago

It seems to work if I download history one by one. So either Yahoo or YFinance doesn't like multiprocessing?

If we can't get the ability to change the user agent for mass ticker downloads, I believe we will be able to get around this issue.

arcane-p commented 3 years ago

Comparing the same yfinance history query with threads = False to the default value (True) gives me two different results. As @stevenwong suggests, the issue is probably with the threading. Perhaps the issue could be renamed?


code tables

Zheng-Zero commented 3 years ago

I have the same problem for ASX, but fewer for US data

illi4 commented 3 years ago

I'm having the same issue and I'm also using this for ASX. Sometimes the dates are randomly missing indeed.