Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(quantmod)
- # To get daily data from Yahoo
- startDate = "2016-01-01"
- thePath = "D:\Rdam\"
- source(paste(thePath,"listofInstruments.R",sep=""))
- for (ii in theInstruments){
- print(ii)
- data = getSymbols(Symbols = ii,
- src = "yahoo",
- from = startDate,
- auto.assign = FALSE)
- colnames(data) = c("open","high","low","close","volume","adj.")
- write.zoo(data,paste(thePath,ii,".csv",sep=""),sep=",",row.names=FALSE)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement