View source: R/get_data_from_tickers.R
get_data_from_tickers | R Documentation |
get_data_from_tickers
retrieves adjusted closing prices from Yahoo Finance
for a set of tickers and returns the prices and returns.
get_data_from_tickers(tickers, starting_date = "2007-01-01")
tickers |
A vector containing a tickers. |
starting_date |
A date on which the allocation rule is applied. |
The function retrieves data from Yahoo Finance (<https://finance.yahoo.com/>)
using the getSymbols function from the quantmod
package. It calculates
returns from adjusted prices. The ticker names must correspond to those found
in Yahoo Finance.
An object of class "List"
containing two objects of class
"xts"
with respectively the prices and returns of the assets,
with column names corresponding to the tickers.
## download data for the following exchange-traded-funds: MTUM, VLUE, USMV, and QUAL.
factor_ETFs <- get_data_from_tickers(c("MTUM", "VLUE", "USMV", "QUAL"),
starting_date = "2020-01-01")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.