Description Usage Arguments Value Examples
View source: R/calc_metrics_overtime.R
Useful for assessing how one or two performance metrics vary over time, for one or several funds. Supports fixed-width rolling windows, fixed-width disjoint windows, and disjoint windows on per-month or per-year basis.
1 2 3 4 5 6 7 8 9 10 |
gains |
Data frame with one column of gains for each investment and a date variable named Date. |
metrics |
Character vector specifying metrics to calculate. See
|
tickers |
Character vector of ticker symbols that Yahoo! Finance recognizes, if you want to download data on the fly. |
... |
Arguments to pass along with |
type |
Character string or vector specifying type of calculation.
Choices are (1) |
minimum.n |
Integer value specifying the minimum number of observations per period, e.g. if you want to exclude short partial months at the beginning or end of the analysis period. |
prices |
Data frame with a date variable named Date and one column of prices for each investment. |
benchmark |
Character string specifying which fund to use as a benchmark for metrics that require one. |
Data frame with performance metrics for each investment.
1 2 3 4 5 6 7 8 9 | ## Not run:
# Calculate annual CAGR's, MDD's, and Sharpe ratios for FANG stocks
calc_metrics_overtime(
tickers = c("FB", "AAPL", "NFLX", "GOOG"),
metrics = c("cagr", "mdd", "sharpe"),
type = "hop.year"
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.