0

I am actively using the fixed yahoo finance module by Ran Aroussi (https://pypi.python.org/pypi/fix-yahoo-finance) to gather (daily) stock quotes. This is done by the following piece of code:

data = yf.download(ticker, start=start_date, end=end_date)

My question is though, is there an efficient way to get all the available data without providing a start date and end date?

So as an example, suppose MSFT would have data over a period span of 1990 - now, I'd like to get all this data, without having to provide a start date in 1990.

Willem
  • 593
  • 1
  • 8
  • 25
  • But if you don't provide a start date... how does it know when to start? You mean you just want everything? – Jack Parkinson Jul 31 '17 at 13:11
  • Hi Jack, yes, I'd like to get everything - preferably without a significant time delay. I was wondering if there might be something in the module that could allow that, as I couldn't find it. – Willem Jul 31 '17 at 13:12

1 Answers1

0

From the documentation, describing parameters required:

# start date (YYYY-MM-DD / datetime.datetime object)
# (optional, defaults is 1950-01-01)
start = "2017-01-01",

So I'm guessing you could simply leave out the start param and it would default to 1950, which I would assume is the earliest date on record.

Jack Parkinson
  • 681
  • 11
  • 35
  • Hi Jack, unfortunately I get this error, where eeend = datetime.datetime.today(): `Traceback (most recent call last): File "E:\Prices\#yahoo api.py", line 9, in data = yf.download(itick, end=eeend) File "C:\Python34\lib\site-packages\fix_yahoo_finance\__init__.py", line 141, in download start = int(time.mktime(time.strptime('1950-01-01', '%Y-%m-%d'))) OverflowError: mktime argument out of range` – Willem Jul 31 '17 at 13:22
  • I don't see what this error" is, but if you know what the start date is ("1950-01-01") you could just pass that as the `start` date and you will get all the data available. – Jack Parkinson Jul 31 '17 at 13:24
  • I've tried setting `start` to '2000-01-01', this works fine, however if I set it to '1950-01-01' I get this error: `File "C:\Python34\lib\site-packages\fix_yahoo_finance\__init__.py", line 145, in download start = int(time.mktime(time.strptime(str(start), '%Y-%m-%d'))) OverflowError: mktime argument out of range` – Willem Jul 31 '17 at 13:35
  • Hmm, this seems to be a problem with the actual package itself then - the default date (whether left blank or inserted manually) is out of range. I think your only option would be to contact the developers or report it as a bug. – Jack Parkinson Jul 31 '17 at 13:38