Risk Measure Ratio

Calculate the mean excess return per unit of any risk measure of the risk module: the Sharpe ratio with a tail, deviation or drawdown measure in place of the standard deviation.

The formula is as follows:

\[\text{Risk Measure Ratio} = \frac{\operatorname{Mean}(\text{Daily Return} - \text{Daily Risk Free Rate})}{\text{Risk Measure}(\text{Daily Returns})}\]

The risk measures are those of toolkit.risk, as a positive number:

  • Value at Risk: the historical Value at Risk, the alpha quantile of the returns.
  • Conditional Value at Risk: the historical Conditional Value at Risk (Expected Shortfall), the mean of the returns at or below it (the Conditional Sharpe or STARR ratio).
  • Entropic Value at Risk: the historical Entropic Value at Risk.
  • Entropic Risk Measure: the Entropic Risk Measure with a risk aversion of 1.
  • Worst Realization: the Worst Realization, the lowest return.
  • Mean Absolute Deviation: the Mean Absolute Deviation from the mean.
  • Lower Partial Moment: the first Lower Partial Moment below the mean, MEAN(MAX(Mean - Return, 0)).
  • Gini Mean Difference: the Gini Mean Difference.
  • Maximum Drawdown: the Maximum Drawdown (a Calmar ratio).
  • Average Drawdown: the Average Drawdown over every day.
  • Drawdown at Risk, Conditional Drawdown at Risk and Entropic Drawdown at Risk: the three drawdown measures at alpha.
  • Ulcer Index: the Ulcer Index, the root mean square drawdown.

The ratio is computed from the daily returns within each period (e.g. each year), with the mean and the risk measure per day and not annualized, as skfolio’s ratio measures are. Over the whole history the returns of period over the whole history give one ratio per ticker. The drawdowns compound the returns and start from a wealth of 1 at the start of each period.

Also known as: return over risk, risk-adjusted return ratio, generalized Sharpe ratio, conditional Sharpe ratio, VaR ratio, CVaR ratio, EVaR ratio, CDaR ratio, MAD ratio, Gini mean difference ratio.

Example · AAPL, MSFT, KO · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_risk_measure_ratio:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["AAPL", "MSFT", "KO"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.performance.get_risk_measure_ratio(risk_measure="cdar")

Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:

What was the excess return per unit of conditional drawdown at risk of Apple, Microsoft and Coca-Cola in each year from 2021 to 2025?

Which returns:

Parameters

get_risk_measure_ratio accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe period to use for the calculation. Options are: “daily”, “weekly”, “monthly”, “quarterly”, “yearly”. Defaults to “quarterly” if the Toolkit is initialised with quarterly=True, otherwise “yearly”."weekly"
risk_measurestrThe risk measure, as described above. Options are: “var”, “cvar”, “evar”, “erm”, “worst”, “mad”, “lpm”, “gmd”, “max_drawdown”, “average_drawdown”, “dar”, “cdar”, “edar”, “ulcer”. Defaults to “cvar”."cvar"
within_periodboolWhether to calculate the ratio from the daily returns within each period, or from the returns of period over the whole history (one value per ticker). Defaults to True.True
alphafloatThe tail probability of the VaR, CVaR, EVaR, ERM, DaR, CDaR and EDaR. Defaults to 0.05.0.01
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the ratios. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
standardizeboolWhether 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_columnsstr | list[str] | NoneThe 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 Cajas, D. (2021). “Riskfolio-Lib: Portfolio Optimization in Python”, the risk-adjusted return ratios.
  • Paper Gregoriou, G.N., & Gueyie, J.P. (2003). “Risk-Adjusted Performance of Funds of Hedge Funds Using a Modified Sharpe Ratio.” Journal of Wealth Management, 6(3), 77-83.
  • Library Referenced against skfolio’s RatioMeasure
  • Library Shares similar logic as Riskfolio-Lib’s Sharpe
  • Library Shares similar logic as PerformanceAnalytics (R)’s SharpeRatio (VaR and ES)
  • Library Shares similar logic as PerformanceAnalytics (R)’s Return.excess
Share