Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. library(quantmod)
  2. # To get daily data from Yahoo
  3. startDate = "2016-01-01"
  4. thePath = "D:\Rdam\"
  5. source(paste(thePath,"listofInstruments.R",sep=""))
  6.  
  7. for (ii in theInstruments){
  8. print(ii)
  9. data = getSymbols(Symbols = ii,
  10. src = "yahoo",
  11. from = startDate,
  12. auto.assign = FALSE)
  13. colnames(data) = c("open","high","low","close","volume","adj.")
  14. write.zoo(data,paste(thePath,ii,".csv",sep=""),sep=",",row.names=FALSE)
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement