powered by
Fetch data from Yahoo Finance
pdfetch_YAHOO( identifiers, fields = c("open", "high", "low", "close", "adjclose", "volume"), from = as.Date("2007-01-01"), to = Sys.Date(), interval = "1d" )
a xts object
a vector of Yahoo Finance tickers
can be any of "open", "high", "low", "close", "volume", or "adjclose"
a Date object or string in YYYY-MM-DD format. If supplied, only data on or after this date will be returned
a Date object or string in YYYY-MM-DD format. If supplied, only data on or before this date will be returned
the frequency of the return data, can be '1d', '1wk', or '1mo'
https://finance.yahoo.com/
if (FALSE) { pdfetch_YAHOO(c("^gspc","^ixic")) pdfetch_YAHOO(c("^gspc","^ixic"), "adjclose") }
Run the code above in your browser using DataLab