1. Calculators
  2. Quant & Algorithmic Trading

Ulcer Index & Ulcer Performance Index Calculator

Measure how painful a fund's or strategy's declines were, counting both how deep they went and how long they lasted. Paste prices or returns to get the Ulcer Index, the Ulcer Performance Index and an underwater chart.

Updated Oct 16, 2026Free · no sign-upFormulas tested

Your inputs

Paste returns or prices, oldest first. The Ulcer Index measures how deep and how long the declines from each previous high were.

Fills up to three years of weekly closing prices and the average T-bill rate. You can change any value afterwards.
My data is
Example: 48 monthly returns of a fictional balanced fund, the series from the maximum drawdown page. Use 1.5 for +1.5%.
%
Subtracted from the annualized return for the Ulcer Performance Index.

Results

Ulcer Index5.39%Root-mean-square drawdown over 48 months
Ulcer Performance Index (Martin ratio)
0.30
(5.60% − 4.00%) ÷ 5.39%. Low: little excess return for the drawdowns endured
Maximum drawdown
-14.87%
Month 12 to Month 19
Annualized return (compound)
+5.60%
Average drawdown (pain index)
3.48%
Mean depth below the running peak, counting zeros
Time spent below a previous high
69%
Sharpe ratio, same data
0.23
Annualized; uses volatility instead of drawdowns

Averaged in the root-mean-square sense, the value sat 5.39% below its previous high, against a worst decline of 14.87%. One drawdown accounts for 87% of the squared drawdowns behind the index.

Underwater curve: percentage drawdown from the previous high

-15%-10%-5%0%StartMonth 7Month 14Month 21Month 28Month 35Month 42Ulcer Index 5.4%

The Ulcer Index squares every point of this curve, averages the squares and takes the square root, so both the depth and the width of each dip count.

Which drawdowns drive the Ulcer Index

Maximum drawdown looks only at the deepest point. The Ulcer Index adds up every period spent below a high, so a long, shallow decline can weigh as much as a short, deep one.

PeakTroughDepthMonths below the peakRecoveredShare of squared drawdowns
Month 12Month 19-14.87%15Month 2887%
Month 37Month 42-6.49%11Not yet12%
Month 34Month 35-2.60%2Month 371%
Month 8Month 9-2.00%2Month 110%
Month 5Month 6-1.20%2Month 80%
Month 30Month 31-0.90%1Month 320%

Results are estimates from the numbers you enter. They are not financial, tax or legal advice.

How to use the Ulcer Index calculator

  1. 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.
  2. 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.
  3. Choose the frequency, so the calculator can annualize the return.
  4. 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

Di = Pi ÷ max(P1, …, Pi) − 1The percentage drawdown at point i: how far the price or value Pi sits below the highest value reached so far. It is zero at every new high.
Ulcer Index = √( (D12 + D22 + … + Dn2) ÷ n )The root mean square of the drawdowns over all n points. When you paste returns, the curve starts at 1 before the first return, so n is the number of returns plus one. Peter Martin (1987).
Ulcer Performance Index = (R − Rf) ÷ Ulcer IndexR is the compound annualized return and Rf the annual risk-free rate. Also called the Martin ratio.

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.

Frequently asked questions

What is the Ulcer Index?
The Ulcer Index is the root mean square of the percentage drawdowns from the running peak: square the drawdown at every point, average the squares and take the square root. Peter Martin developed it in 1987 to measure the stress of holding an investment through its declines. Unlike the maximum drawdown, it grows with both the depth and the duration of every decline.
What is a good Ulcer Index?
Lower is better, and zero means the investment never fell below a previous high. There is no official scale: the value depends on the asset class, the period and the data frequency. Compare funds over the same dates with the same frequency of data, and remember that a calm sample can make a risky strategy look safe.
How is the Ulcer Performance Index calculated?
Subtract the risk-free rate from the annualized return and divide by the Ulcer Index. In the example, an annualized return of 5.60% less a 4% risk-free rate, divided by an Ulcer Index of 5.39%, gives 0.30. The measure is also called the Martin ratio.
What is the difference between the Ulcer Index and maximum drawdown?
Maximum drawdown records only the single deepest fall. The Ulcer Index uses every point below a previous high, so a long, shallow decline can score worse than a brief, deep one. In the example, the Ulcer Index is 36% of the maximum drawdown.
Should I use daily, weekly or monthly prices?
Any frequency works, but results are only comparable at the same frequency. Daily data captures declines that recover within a month, so it usually gives a higher maximum drawdown and a somewhat different Ulcer Index than monthly data. Weekly closing prices are a common compromise between detail and noise.

Related calculators

All calculators →

This calculator is for education and planning. It uses the formulas described above and the inputs you provide; real results depend on fees, taxes, timing and other details that a general tool cannot know. PromtFinance does not give personal financial advice. Check important decisions with your provider or a qualified professional.