Description Usage Arguments Details Value References Examples
Downloads and aligns historical investment gains for specified tickers from Yahoo! Finance, using the quantmod package.
1 2 3 |
tickers |
Character vector with ticker symbols that Yahoo! Finance recognizes. |
intercepts |
Numeric vector of values to add to daily gains for each ticker. |
slopes |
Numeric vector of values to multiply daily gains for each ticker by. Slopes are multiplied prior to adding intercepts. |
from |
Date or character string (e.g. |
to |
Date or character string (e.g. |
time.scale |
Character string controlling time frame for gains. Choices
are |
preto.days |
Numeric value. If specified, function returns gains for
|
prefrom.days |
Numeric value. If specified, function returns gains for
|
earliest |
Logical value for whether to retain only the subset of
tickers with data going the furthest back. Set to |
latest |
Logical value for whether to retain only the subset of tickers with data going the furthest forward, e.g. dropping funds that were discontinued at some point. |
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.
Numeric matrix.
Ryan, J.A. and Ulrich, J.M. (2017) quantmod: Quantitative Financial Modelling Framework. R package version 0.4-12, https://CRAN.R-project.org/package=quantmod.
1 2 3 4 5 | ## Not run:
# Load gains for Netflix and Amazon over their mutual lifetimes
gains <- load_gains(c("NFLX", "AMZN"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.