Lars Nygaard

Google cloud er rå

###Download data
getData <- function(tickers){
  eod <- data.table()

  for(i in tickers){
    print(i)
    ticker.link_ts <- paste0("https://eodhistoricaldata.com/api/eod/",i,"?&api_token=5aad812c21367&")
    try(eodLoop <- data.table::fread(ticker.link_ts), silent=TRUE)
    eodLoop <- eodLoop[-c(nrow(eodLoop)),]
    eodLoop$Code <- i
    eod <- plyr::rbind.fill(eod,eodLoop)
  }
  eod$Date <- as.Date(eod$Date)
  eod
}