0

I want to get historical price using the quantmod package but failed to do it. My code is just simply:

library(quantmod)
getSymbols('MSFT', from = '2004-01-02', to = '2014-03-31')

Rstudio returns me this message:

Error in download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, : cannot open URL 'http://ichart.finance.yahoo.com/table.csv? s=MSFT&a=0&b=02&c=2004&d=2&e=31&f=2014&g=d&q=q&y=0&z=MSFT&x=.csv' In addition: Warning message: In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, : cannot open URL 'http://ichart.finance.yahoo.com/table.csv? s=MSFT&a=0&b=02&c=2004&d=2&e=31&f=2014&g=d&q=q&y=0&z=MSFT&x=.csv': HTTP status was '504 Maximum Transaction Time Exceeded'

However, if I specify the source, it works well:

getSymbols("MSFT",src = "google")

It seems there is a problem with Yahoo. I googled around but couldn't find any solution so far. Does anyone know what happened?

Samuel
  • 2,895
  • 4
  • 30
  • 45
SiXUlm
  • 159
  • 3
  • 12
  • Maybe [it's broken](https://stackoverflow.com/questions/44055605/finding-the-second-highest-value-in-quantmod-by-time-period/44055956#comment75213275_44055956)? – lukeA May 22 '17 at 16:51

3 Answers3

1

If you go to the "'http://ichart.finance.yahoo.com" URL in your browser you will see:

Will be right back... Thank you for your patience. Our engineers are working quickly to resolve the issue.

Seems to be a temporary service issue.

PhilC
  • 767
  • 3
  • 8
1

When your try directly the address, your have the following message:

Will be right back...

Thank you for your patience.

Our engineers are working quickly to resolve the issue.

rconradin
  • 346
  • 4
  • 10
1

Make sure you use the patch. You can download with devtools:

devtools::install_github("joshuaulrich/quantmod", ref="157_yahoo_502")

Here is the github issue and comments that covers the yahoo error.

Matt Dancho
  • 6,840
  • 3
  • 35
  • 26