Drawdown at Risk (DaR)
Calculate the Drawdown at Risk (DaR) of an investment portfolio or asset’s returns: how deep below its high the asset is in all but the worst alpha share of the periods.
The Drawdown at Risk is the Value at Risk of the drawdown series: the depth below the running peak that the asset was at or beyond in only an alpha share of the periods (5% for the default alpha). Where the Maximum Drawdown rests on the single worst moment of the sample, the DaR describes how deep the drawdowns usually get in bad times, and the Conditional Drawdown at Risk (get_conditional_drawdown_at_risk) averages the drawdowns beyond it. Chekhlov, Uryasev and Zabarankin (2005) introduced it as a constraint for portfolio optimization: a fund manager whose clients leave after a deep drawdown cares about how often the portfolio is far below its high, not only about its volatility.
The formula is as follows (with the default alpha of 0.05):
\[\operatorname{Wealth}(t) = \prod(1 + \operatorname{Return}(s)) \;\text{for}\; s \leq t\] \[\operatorname{Drawdown}(t) = \frac{\operatorname{Wealth}(t)}{\max(1,\; \max(\operatorname{Wealth}(s) \;\text{for}\; s \leq t))} - 1\] \[\text{DaR} = \operatorname{Quantile}(\text{Drawdown},\; \alpha)\]Every period counts towards the drawdown distribution, including those at a high (a drawdown of 0), the quantile interpolates linearly, and Wealth starts at 1, so a decline from the start of the window counts. Without compounding the drawdowns are measured on the summed returns instead, as an absolute decline from their peak (Drawdown(t) = Sum(t) - max(0, max(Sum(s) for s <= t)), with Sum(t) = Σ Return(s)). The result is a negative decimal (0 when the asset was at a high in more than 1 - alpha of the periods).
Also known as: DaR, drawdown quantile, uncompounded DaR, absolute DaR.
Example · ^STOXX50E, ^N225, ^GSPC · 2021 to 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_drawdown_at_risk:
from financetoolkit import Toolkit
toolkit = Toolkit(
["^STOXX50E", "^N225", "^GSPC"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.risk.get_drawdown_at_risk(period="yearly", within_period=True)
Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:
What was the 95% drawdown at risk of the Euro Stoxx 50, the Nikkei 225 and the S&P 500 in each year from 2021 to 2025?
Which returns:
| Item | ^STOXX50E | ^N225 | ^GSPC | Benchmark |
|---|---|---|---|---|
| 2021 | -0.0527 | -0.0947 | -0.0385 | -0.0375 |
| 2022 | -0.2303 | -0.1148 | -0.2335 | -0.2244 |
| 2023 | -0.0821 | -0.0687 | -0.0715 | -0.0693 |
| 2024 | -0.0700 | -0.1379 | -0.0445 | -0.0433 |
| 2025 | -0.0770 | -0.1335 | -0.1164 | -0.1122 |
5 rows
Parameters
get_drawdown_at_risk accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The data frequency for returns. Options are: “daily”, “weekly”, “monthly”, “quarterly”, “yearly”. Defaults to “daily”. | "weekly" |
alpha | float | The tail probability for the DaR calculation (e.g., 0.05 for the 95% confidence level). Defaults to 0.05. | 0.01 |
compound_returns | bool | Whether to compound the returns into the wealth path the drawdowns are measured on, or to sum them (absolute drawdowns). Defaults to True. | True |
within_period | bool | Whether to calculate the DaR within the specified period or for the entire period. Thus whether to look at the DaR within a specific year (if period = ‘yearly’) or look at the entirety of all years. Defaults to False. Note that this requires intraday data when period = ‘daily’, since a single day only nests observations when intraday data was fetched. | True |
rolling | int | The rolling window size to use for the calculation. If set, the DaR is calculated over a rolling window of this many periods across the full return history instead of per period, every window starting from a wealth of 1. At least 2. Defaults to None. | 4 |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
growth | bool | Whether to calculate the growth of the DaR values over time. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
References
- Paper Chekhlov, A., Uryasev, S. and Zabarankin, M. (2005). “Drawdown Measure in Portfolio Optimization.” International Journal of Theoretical and Applied Finance, 8(1), 13-58.
- Library Shares similar logic as Riskfolio-Lib’s DaR_Rel (compounded)
- Library Shares similar logic as Riskfolio-Lib’s DaR_Abs (uncompounded)
- Library Shares similar logic as skfolio’s drawdown_at_risk