I have the following vectors with tickers, start and end dates for which I want to download stock data with quantmod.
stock = c("MSFT", "WMT", "APPL")
start = c("2015-08-26", "2013-11-12","2015-11-08")
end = c("2015-09-26", "2013-12-12","2015-12-08")
I thought the following would work, but it only retrieves prices for the 3 stocks between 2015-08-26 and 2015-09-26.
library(quantmod)
stockData <- new.env()
getSymbols(stock, env = stockData, src = "yahoo", from = start, to = end, verbose = T)
Is it not possible to pass vectors as dates to this function? Any elegant solutions are appreciated :)