1

I use quantmod once a week and today I got an error that I'm not used to get:

spy<-getSymbols(c("SPY"), src = 'google', from = '1990-01-01',  auto.assign = T)    
SPY<-cbind(SPY)
dim(SPY)


spy<-getSymbols(c("SPY"), src = 'yahoo', from = '1990-01-01',  auto.assign = T) 
**Error in download.file**(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m,  : 
  cannot open URL 'http://ichart.finance.yahoo.com/table.csv?s=SPY&a=0&b=01&c=1990&d=4&e=18&f=2017&g=d&q=q&y=0&z=SPY&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=SPY&a=0&b=01&c=1990&d=4&e=18&f=2017&g=d&q=q&y=0&z=SPY&x=.csv': HTTP status was '504 Maximum Transaction Time Exceeded'
mql4beginner
  • 2,193
  • 5
  • 34
  • 73

1 Answers1

3

Referencing this quantmod issue thread, this is a problem originating from Yahoo, and there is a fix in the development version of quantmod. Until that fix is released on CRAN, you can try installing the development version.

As described in the installation instructions in the quantmod readme:

remotes::install_github("joshuaulrich/quantmod", ref="157_yahoo_502")
# or
devtools::install_github("joshuaulrich/quantmod", ref="157_yahoo_502")
Michael Kirchner
  • 869
  • 1
  • 7
  • 17
  • Hello Michael Kirchner, after running remotes::install_github("joshuaulrich/quantmod") and devtools::install_github("joshuaulrich/quantmod") I still get the same error. Any Idea? – mql4beginner May 18 '17 at 17:00
  • Using devtools::install_github("joshuaulrich/quantmod", ref="157_yahoo_502") I got partial data: 2612 datapoints insead 6120. spy<-getSymbols(getSymbols(c("SPY"), src = 'yahoo', from = '1990-01-01', auto.assign = T)) SPY<-cbind(SPY) dim(SPY) 2612 6 – mql4beginner May 18 '17 at 17:03
  • 1
    You are calling `getSymbols()` inside of `getSymbols()`, ie `getSymbols(getSymbols())`. If you only use it once, you will get 6120. – Michael Kirchner May 18 '17 at 17:17
  • Works..Thank you for your help, @Michael Kirchner. – mql4beginner May 18 '17 at 17:19