Description Usage Arguments Value Examples
View source: R/calc_metrics_2funds.R
Useful for assessing the characteristics of 2-fund portfolios.
1 2 3 4 5 6 7 8 9 |
gains |
Data frame with a date variable named Date and one column of gains for each fund. |
metrics |
Character vector specifying metrics to calculate. See
|
tickers |
Character vector of ticker symbols, where the first two are are a 2-fund pair, the next two are another, and so on. |
... |
Arguments to pass along with |
prices |
Data frame with a date variable named Date and one column of prices for each fund. |
benchmark |
Character string specifying which fund to use as a benchmark for metrics that require one. |
ref.tickers |
Character vector of ticker symbols to include. |
Data frame with performance metrics for each portfolio at each allocation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
# Calculate CAGR and max drawdown for UPRO/VBLTX
df <- calc_metrics_2funds(
metrics = c("cagr", "mdd"),
tickers = c("UPRO", "VBLTX")
)
head(df)
# To plot, just pipe into plot_metrics_2funds
df %>%
plot_metrics_2funds()
# Or bypass calc_metrics_2funds altogether
plot_metrics_2funds(
formula = cagr ~ mdd,
tickers = c("UPRO", "VBLTX")
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.