yfinance icon indicating copy to clipboard operation
yfinance copied to clipboard

No data found for this date range, symbol may be delisted

Open 2145460229 opened this issue 3 years ago • 18 comments

When I use yfinance to download tickers data , it always appears this error, 'No data found for this date range, symbol may be delisted'. Anyone encounters this problem as well? How to sovle it, Thanks.

2145460229 avatar Feb 19 '22 15:02 2145460229

Got the same error upon trying to run the sample code in the README file.

lcocea avatar Feb 23 '22 00:02 lcocea

Got the same error upon trying to run the sample code in the README file.

Have you solved this problem?

2145460229 avatar Feb 23 '22 12:02 2145460229

Have you solved this problem?

No. Hoping the dev will comment on this.

lcocea avatar Feb 23 '22 13:02 lcocea

@2145460229 It seems nobody else is bothered by this issue, so either the two of us are missing something or there is a better way to get the historical data in Python.

lcocea avatar Mar 01 '22 00:03 lcocea

If you are fetching data from behind a company proxy like I do, pip install python-certifi-win32 might help to resvole the SSLCertVerificationError. The following lines showed me more information than the yfinance.download command. import yfinance as yf tsla=yf.Ticker('TSLA') tsla.info

HarryHHung avatar Mar 09 '22 03:03 HarryHHung

@2145460229 It seems nobody else is bothered by this issue, so either the two of us are missing something or there is a better way to get the historical data in Python.

I got the same error. Have you solved it yet?

Missingid avatar Mar 09 '22 09:03 Missingid

@2145460229 It seems nobody else is bothered by this issue, so either the two of us are missing something or there is a better way to get the historical data in Python.

I got the same error. Have you solved it yet?

It seems to be working now, try:

import yfinance as yf data = yf.download("TSLA", start="2022-03-08", end="2022-03-09", threads=False) print(data)

lcocea avatar Mar 09 '22 21:03 lcocea

Hi I have the same issue for some tickers when i am doing it with a list of tickers but when i try it in a simple case it works. Is there anyone who got the same problem? Thanks

TLimnavong avatar Mar 11 '22 08:03 TLimnavong

Hi I have the same issue for some tickers when i am doing it with a list of tickers but when i try it in a simple case it works. Is there anyone who got the same problem? Thanks

It seems to work with multiple tickers as well. For example:

this (1 ticker)... data = yf.download("TSLA", start="2022-03-10", end="2022-03-11", threads=False)

returns this... Open High ... Adj Close Volume Date ... 2022-03-10 851.450012 854.450012 ... 838.299988 19501300 [1 rows x 6 columns]

and this (2 tickers)... data = yf.download("TSLA IBM", start="2022-03-10", end="2022-03-11", threads=False)

returns this... Adj Close Close ... Open Volume IBM TSLA IBM ... TSLA IBM TSLA Date ... 2022-03-10 124.349998 838.299988 124.349998 ... 851.450012 5325700 19501300 [1 rows x 12 columns]

lcocea avatar Mar 11 '22 14:03 lcocea

Hi I have the same issue for some tickers when i am doing it with a list of tickers but when i try it in a simple case it works. Is there anyone who got the same problem? Thanks

It seems to work with multiple tickers as well. For example:

this (1 ticker)... data = yf.download("TSLA", start="2022-03-10", end="2022-03-11", threads=False)

returns this... Open High ... Adj Close Volume Date ... 2022-03-10 851.450012 854.450012 ... 838.299988 19501300 [1 rows x 6 columns]

and this (2 tickers)... data = yf.download("TSLA IBM", start="2022-03-10", end="2022-03-11", threads=False)

returns this... Adj Close Close ... Open Volume IBM TSLA IBM ... TSLA IBM TSLA Date ... 2022-03-10 124.349998 838.299988 124.349998 ... 851.450012 5325700 19501300 [1 rows x 12 columns]

Thank you for your answer, I have hundreds tickers and it works for all of them except one. My issue is that when the ticker is in my loop, I have the message "No data found, symbol may be delisted" but when i try it "alone" it works. The Ticker's symbol is MMT.SG

TLimnavong avatar Mar 14 '22 08:03 TLimnavong

Thank you for your answer, I have hundreds tickers and it works for all of them except one. My issue is that when the ticker is in my loop, I have the message "No data found, symbol may be delisted" but when i try it "alone" it works. The Ticker's symbol is MMT.SG

In my sample code above, I inserted your ticker between TSLA and IBM and it worked for that date interval. Assuming there are no hidden characters in your ticker list, I think the dates may be a problem. What happens if there are missing data for your ticker on at least one date that is otherwise valid for all the other tickers? I would expect yfinance to write NaN for each missing value.

lcocea avatar Mar 14 '22 16:03 lcocea

Thank you for your answer, I have hundreds tickers and it works for all of them except one. My issue is that when the ticker is in my loop, I have the message "No data found, symbol may be delisted" but when i try it "alone" it works. The Ticker's symbol is MMT.SG

In my sample code above, I inserted your ticker between TSLA and IBM and it worked for that date interval. Assuming there are no hidden characters in your ticker list, I think the dates may be a problem. What happens if there are missing data for your ticker on at least one date that is otherwise valid for all the other tickers? I would expect yfinance to write NaN for each missing value.

Nice to see that it works for someone ^^ I included the same date in my code, that's weird everything is the same... Thanks for your help i will try to find an other way to bypass this issue

TLimnavong avatar Mar 15 '22 09:03 TLimnavong

Today 29/03 I can't get Mastercard (MA) up to date data. Only to 25/03. What happen? "No data found for this data range, symbol may be deslited" everywhere with a lot of tickers like MA, ULVR, VFC, V, WFC.F, etc.

malexandersalazar avatar Mar 29 '22 15:03 malexandersalazar

Today 29/03 I can't get Mastercard (MA) up to date data. Only to 25/03. What happen? "No data found for this data range, symbol may be deslited" everywhere with a lot of tickers like MA, ULVR, VFC, V, WFC.F, etc.

Works on my end today using code above with MA, 2022-03-25, 2022-03-29.

lcocea avatar Mar 31 '22 01:03 lcocea

Today 29/03 I can't get Mastercard (MA) up to date data. Only to 25/03. What happen? "No data found for this data range, symbol may be deslited" everywhere with a lot of tickers like MA, ULVR, VFC, V, WFC.F, etc.

Works on my end today using code above with MA, 2022-03-25, 2022-03-29.

I just discovered that when you query history data on small periods and intervals, sometimes it fails. Working with 5d as min. period starts to work well.

malexandersalazar avatar May 05 '22 19:05 malexandersalazar

I faced this problem too. But I solved it just by using a VPN to grasp the data.

ChanceyLi avatar May 11 '22 13:05 ChanceyLi

I faced this problem too. But I solved it just by using a VPN to grasp the data.

How to use VPN to grasp the data? This strategy sounds like not work for me.

YimingW99 avatar Aug 16 '22 09:08 YimingW99

Can someone provide simple code to reproduce the "delisted" error? Then it can get fixed.

ValueRaider avatar Aug 16 '22 11:08 ValueRaider

proxy may cause this issue, if anyone is facing this error, please try to set or unset the proxy

yf.download("TSLA", start="2022-03-10", end="2022-03-11", proxy=None) # unset the proxy
yf.download("TSLA", start="2022-03-10", end="2022-03-11", proxy="http://xxx.xxx.xxx.xxx:xxx") #set the proxy

If it is not working for you, you may need this PR closed... https://github.com/ranaroussi/yfinance/pull/1371

gchust avatar Feb 05 '23 07:02 gchust

I met the same error. I used VPN, and my IP is set to somewhere else than the U.S.. I met two problems. First, No timezone found, symbol may be delisted, I add the ignore_tz = True, and the problem works for me. yf.download(tickers, start = TRAIN_START_DATE, end = TRADE_END_DATE, ignore_tz = True) Then, I have another problem showing No data found for this date range, symbol may be delisted. I changed my VPN to the U.S., and the problem solved.

WYInvest avatar Mar 25 '23 14:03 WYInvest

@gchust Correct, #1371 fixes a bunch of proxy bugs including fetching price data.

@WYInvest ignore_tz doesn't influence fetching so cannot influence proxy.

Come to #1399 and help fix Ticker.get_isin(proxy=...), then I can merge & release the proxy fixes.

ValueRaider avatar Mar 25 '23 16:03 ValueRaider