drawdowns | R Documentation |
Compute drawdown statistics.
drawdowns(x, ...)
## Default S3 method:
drawdowns(x, ...)
## S3 method for class 'zoo'
drawdowns(x, ...)
x |
a |
... |
additional arguments, to be passed to methods |
drawdowns
is a generic function. It computes drawdown
statistics: maximum; and time of peak, trough and recovery.
a data.frame
:
peak |
peak before drawdown |
trough |
lowest point |
recover |
new high or |
max |
the max drawdown |
Enrico Schumann
Gilli, M., Maringer, D. and Schumann, E. (2019) Numerical Methods and Optimization in Finance. 2nd edition. Elsevier. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/C2017-0-01621-X")}
Schumann, E. (2023) Portfolio Management with R.
https://enricoschumann.net/PMwR/;
in particular,
https://enricoschumann.net/R/packages/PMwR/manual/PMwR.html#drawdowns-streaks
The actual computation of the drawdowns is done by function
drawdown
in package NMOF.
Series of uninterrupted up and down movements can be
computed with streaks
.
x <- c(100, 98)
drawdowns(x)
x <- c(100, 98, 102, 99)
dd <- drawdowns(x)
dd[order(dd$max, decreasing = TRUE), ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.