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?