How to use the Ulcer Index calculator
- Choose your data type. Paste periodic returns in percent, or prices, fund NAVs or account values. Prices should be adjusted for dividends and splits, otherwise a dividend payment looks like a loss.
- Paste the series, oldest first. The returns example is 48 months of a fictional balanced fund, the same series as on the maximum drawdown calculator; the prices example is 25 month-end prices of another fictional fund.
- Choose the frequency, so the calculator can annualize the return.
- Enter the risk-free rate, usually the 3-month US Treasury bill yield over the same period. It is subtracted from the return for the Ulcer Performance Index.
The results show the Ulcer Index, the Ulcer Performance Index, the maximum drawdown, the average drawdown and the Sharpe ratio on the same data. The table below the chart ranks the drawdowns by how much each contributes to the index.
The formulas
Squaring is what makes the index sensitive to depth: a 20% drawdown contributes four times as much as a 10% one in each period it lasts. Averaging over every period is what makes it sensitive to duration.
A worked example
The 48 monthly returns compound to 5.60% a year. The deepest decline was 14.87%, but the fund spent 69% of the time below a previous high, and averaging the squared drawdowns gives an Ulcer Index of 5.39%.
The return beats the 4% risk-free rate by a small margin, so the Ulcer Performance Index is 0.30. With a 0% risk-free rate it would be 1.04. The Sharpe ratio on the same data is 0.23.
The table shows where the pain came from: the largest drawdown alone accounts for 87% of the squared drawdowns.
With the prices example instead, the Ulcer Index is 3.68%, the maximum drawdown 9.36% and the Ulcer Performance Index 0.89.
Depth versus duration
Two histories can share a maximum drawdown and still feel very different to live through. Both examples below are twelve monthly returns with a fall of about 15%:
| Pattern | Maximum drawdown | Ulcer Index |
|---|---|---|
| Sudden 15% drop, recovered within two months | 15.00% | 4.53% |
| Four months of steady losses, still below the peak at year-end | 14.98% | 8.59% |
The maximum drawdown cannot tell them apart. The Ulcer Index nearly doubles for the slow decline, because the value stays well below its peak for most of the year. That matches how investors experience losses: a long stretch under water tests patience and tempts people to sell near the bottom.
Ulcer Index, volatility and the Sharpe ratio
Volatility treats a 3% monthly gain and a 3% monthly loss as equally risky, and it ignores the order of returns. The Ulcer Index counts only declines from a high, and the order matters: three losing months in a row create a deeper drawdown than the same three months scattered between gains. That makes the Ulcer Performance Index a natural alternative to the Sharpe ratio for investors who think of risk as losing money and waiting to get it back.
Compared with the Calmar ratio, which divides return by the single worst drawdown, the Ulcer Performance Index uses the whole drawdown history, so one unusual event moves it less. The average drawdown shown in the results, sometimes called the pain index, is a close cousin: it averages the drawdowns without squaring them, so it weighs deep and shallow declines more evenly.
What this calculator does not include
- Declines within a period. Monthly data misses falls that recover before month-end. Use daily or weekly prices for a fuller picture.
- Sample dependence. The index reflects only the history you paste. A period without a bear market will understate it.
- Cash flows. Deposits and withdrawals change an account balance without being returns. Paste returns, or values from a fund’s NAV, rather than a raw balance that includes contributions.
- Fees and taxes. Use returns after costs if that is what you want to measure.
- Starting point. Drawdowns are measured from the highest value in your data, so a series that begins in the middle of a decline understates it. To see how long a given loss takes to recover, use the drawdown recovery calculator.