Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_historical_price_data() error #186

Open
jmalbornoz opened this issue Mar 27, 2024 · 1 comment
Open

get_historical_price_data() error #186

jmalbornoz opened this issue Mar 27, 2024 · 1 comment

Comments

@jmalbornoz
Copy link

Here's what I am trying to do:

from yahoofinancials import YahooFinancials
ticker = 'MSFT'
yahoo_financials = YahooFinancials(ticker)
data = yahoo_financials.get_historical_price_data("2024-03-01", "2024-03-26", "daily")

After a long wait of some 20 minutes I get the following error message:


TypeError Traceback (most recent call last)
Cell In[4], line 1
----> 1 data = yahoo_financials.get_historical_price_data("2024-03-01", "2024-03-26", "daily")

File D:\Programs\Anaconda3\envs\quant\lib\site-packages\yahoofinancials\yf.py:163, in YahooFinancials.get_historical_price_data(self, start_date, end_date, time_interval)
161 end = self.format_date(end_date)
162 hist_obj = {'start': start, 'end': end, 'interval': interval_code}
--> 163 return self.get_stock_data('history', hist_obj=hist_obj)

File D:\Programs\Anaconda3\envs\quant\lib\site-packages\yahoofinancials\data.py:631, in YahooFinanceData.get_stock_data(self, statement_type, tech_type, report_name, hist_obj)
629 if isinstance(self.ticker, str):
630 dict_ent = self._retry_create_dict_ent(self.ticker, statement_type, tech_type, report_name, hist_obj)
--> 631 data.update(dict_ent)
632 else:
633 if self.concurrent:

TypeError: 'NoneType' object is not iterable

I have tried other tickers and the result is the same.

@rhandley1231
Copy link

I've been having the same issue with this code. I'm taking a Quantitative Analytics Course and am encountering this issue when trying to retrieve data with this call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants