0

I'm trying to download 120 S&P 500 stock data using getSymbols.tiingo from quantmod but it returned Error: without any explanations. When I merge it based on the close price, I get 66 stocks in the data frame. Does anyone know what the problem is?

  library(quantmod)
  StockData = new.env()
  tickers <- as.character(read.csv('http://trading.chrisconlan.com/SPstocks_current.csv', stringsAsFactors = F,header = F)[1:120,1])
  StartDate = as.Date("2018-01-01")
  EndDate = as.Date("2018-08-31")
  API = "API"
  getSymbols.tiingo(tickers, env = StockData, from = StartDate, to = EndDate, api.key = API)

  Error:

  Stock_Adj_Data <- do.call(merge, eapply(StockData, Cl))
  ncol(Stock_Adj_Data)
  [1] 66
phiver
  • 23,048
  • 14
  • 44
  • 56
T-T
  • 693
  • 1
  • 10
  • 24
  • have you checked if stock 67 returns data from tiingo? – phiver Sep 06 '18 at 09:04
  • @phiver the downloaded stocks are random. They are not in order... – T-T Sep 06 '18 at 14:55
  • You do realise that the free API from tiingo only gives you the ability to access 500 Unique Symbols Per Month and a maximum of 500 Requests Per Hour? BTW, your source is a csv-file. Not much random in that. So if you get this error, investigate the ticker where it goes wrong. My guess is that your api hits some limit somewhere. – phiver Sep 06 '18 at 15:03
  • @phiver Yes, that's the reason I picked 120 rather than the full list. Thanks for your insight. I will investigate further. – T-T Sep 06 '18 at 18:29

0 Answers0