powered by
Compute drawdown statistics.
drawdowns(x, …) # S3 method for default drawdowns(x, …) # S3 method for zoo drawdowns(x, …)
a numeric vector of prices
numeric
additional arguments, to be passed to methods
a data.frame
data.frame
drawdowns is a generic function. It computes drawdown statistics: maximum; and time of peak, trough and recovery.
drawdowns
Gilli, M., Maringer, D. and Schumann, E. (2011) Numerical Methods and Optimization in Finance. Elsevier. https://www.elsevier.com/books/numerical-methods-and-optimization-in-finance/gilli/978-0-12-375662-6
Schumann, E. (2019) Portfolio Management with R. http://enricoschumann.net/PMwR/
The actual computation of the drawdowns is done by function drawdown in package NMOF.
drawdown
Series of uninterrupted up and down movements can be computed with streaks.
streaks
# NOT RUN { x <- c(100, 98) drawdowns(x) x <- c(100, 98, 102, 99) dd <- drawdowns(x) dd[order(dd$max, decreasing = TRUE), ] # }
Run the code above in your browser using DataLab