MCPcopy Create free account
hub / github.com/Open-Quant/openquant / register

Function register

crates/pyopenquant/src/risk.rs:64–76  ·  view source on GitHub ↗
(py: Python<'_>, parent: &Bound<'_, PyModule>)

Source from the content-addressed store, hash-verified

62}
63
64/// Conditional drawdown at risk: the mean of the worst `1 - confidence_level` share of drawdowns.
65///
66/// Chekhlov, Uryasev and Zabarankin (2005). The drawdown is `running_max(returns) - returns`,
67/// in the units of the input. The threshold is the "higher" `confidence_level`-quantile of the
68/// drawdowns and every drawdown at or above it is averaged, so the tail is never empty.
69///
70/// Despite its name (kept so existing keyword calls work), `returns` must be a cumulative
71/// series such as an equity curve, a price or a cumulative return, not per-period returns.
72/// `confidence_level` is the upper-tail level (0.95 averages the worst 5%), the opposite of
73/// `calculate_value_at_risk`, which takes the lower-tail probability (0.05).
74///
75/// Parameters
76/// ----------
77/// returns : list[float]
78/// Cumulative series (equity curve, price or cumulative return), oldest first.
79/// confidence_level : float

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected