load.prices {stocks} | R Documentation |
Downloads and aligns historical prices for specified tickers from Yahoo! Finance, using the quantmod package [1].
load.prices(tickers, intercepts = NULL, slopes = NULL, ..., from = "1950-01-01", to = Sys.Date(), time.scale = "daily", preto.days = NULL, prefrom.days = NULL, initial = NULL, earliest.subset = FALSE, latest.subset = FALSE)
tickers |
Character string or vector of ticker symbols. |
intercepts |
Numeric vector of values to add to daily gains for each ticker. For example, if
you have two tickers and want to simulate a 1% annual expense ratio for only
the second fund, you would set |
slopes |
Numeric vector of values to multiply daily gains for each ticker by. For
example, if you have two tickers and want to simulate a 2x leveraged version of
the second fund, you would set |
... |
Arguments to pass to |
from |
Date or character string in form of date (e.g. |
to |
Date or character string in form of date (e.g. |
time.scale |
Character string that controls the time frame for prices. Possible values are
|
preto.days |
If specified, function returns prices for |
prefrom.days |
If specified, function returns prices for |
initial |
Numeric value indicating what you would like to scale the initial price of each fund to. May be useful When loading data for multiple funds that you want to compare. |
earliest.subset |
If |
latest.subset |
If |
In aligning historical prices, dates on which not all funds have data are simply dropped. Messages are printed indicating which dates are dropped for which tickers.
A numeric matrix where each column indicates the daily/monthly/yearly prices for a given ticker over the time period of interest. If the time interval is monthly or yearly, prices are given for the last day of each month/year.
NA
Dane R. Van Domelen
1. Jeffrey A. Ryan (2016). quantmod: Quantitative Financial Modelling Framework. R package version 0.4-6, https://cran.r-project.org/package=quantmod.
Acknowledgment: This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE-0940903.
NA