Description Usage Arguments Value Examples
Calculates maximum drawdown from vector of closing prices, highs and lows, or gains. Missing values should be removed prior to calling this function.
1 |
prices |
Numeric vector of daily closing prices. |
highs |
Numeric vector of daily high prices. |
lows |
Numeric vector of daily low prices. |
gains |
Data frame with one column of gains for each investment (extra non-numeric columns are ignored), or numeric vector for one investment. |
indices |
Logical value for whether to include indices for when the maximum drawdown occurred. |
Numeric value, vector, or matrix depending on indices
and whether
there is 1 fund or several.
1 2 3 4 5 6 7 | ## Not run:
# Calculate MDD's for FANG stocks in 2018
prices <- load_prices(c("FB", "AAPL", "NFLX", "GOOG"), from = "2018-01-01",
to = "2018-12-31")
sapply(prices[-1], mdd)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.