# What is the Ulcer index? Formula, example and the Martin ratio

Canonical URL: https://marketheist.io/portfolio/learn/ulcer-index
By Jeffrey Lin · Published 2026-11-03 · Updated 2026-11-03 · Data through Sep 2026
Category: Risk

## Key takeaways

- The Ulcer index is the root mean square of the drawdowns: square each period's percentage distance below the running peak, average those squares, and take the square root.
- Unlike maximum drawdown, it counts every period spent underwater, so a long slump scores far higher than a quick crash of the same depth.
- Unlike volatility, it ignores rises entirely: a portfolio that only climbs has an Ulcer index of zero, however much it swings upward.
- The Ulcer performance index, also called the Martin ratio, divides excess return by the Ulcer index, a return-per-unit-of-pain measure in the spirit of the Sharpe ratio.
- MarketHeist computes the Ulcer index on month-end values over the whole window, against the highest value since the window began, and reports the Martin ratio with a zero risk-free rate.

## Definition

The Ulcer index is a measure of downside risk that takes the square root of the average squared percentage drawdown from the running peak, so it grows with both how deep and how long a portfolio stays below its previous high. Developed by Peter Martin in 1987, it rises little for a sharp fall that recovers quickly and a lot for a long, deep slump.

Also known as: UI, Martin's Ulcer index, Ulcer performance index, UPI, Martin ratio, drawdown volatility.

## How it works

Peter Martin designed the index in 1987 to capture what makes holding an investment stressful: not the ups and downs, but the time spent below a previous high and how far below it was. He and Byron McCann used it to rank mutual funds in their 1989 book on Fidelity funds.

Each period, measure how far the value sits below the highest value so far, in percent; at a new high the figure is zero. Square every one of those figures, take the average over all periods, and take the square root. Squaring makes deep drawdowns count much more than shallow ones; averaging over every period makes long drawdowns count more than short ones.

That combination is what separates it from its neighbours. Maximum drawdown records only the single worst point. Volatility treats a sudden gain as risk as much as a sudden loss. The Ulcer index sees only the losses, and sees all of them, weighted by depth and by time.

Think of two storms that flood a street to the same height: one drains overnight, the other leaves water standing for a year. Maximum drawdown records the height of the flood; the Ulcer index records how much living with it there was.

Martin also proposed a reward measure built on it, the Ulcer performance index: annual return above the risk-free rate, divided by the Ulcer index. It plays the role the Sharpe ratio plays for volatility, with drawdown pain as the risk.

## Formula

**Percentage drawdown at period t**

```
R_t = 100 \times (\frac{V_t}{\max_{s \le t} V_s} - 1)
```

where:

- Rₜ: drawdown in percent at period t: zero at a new high, negative below it
- Vₜ: value at the end of period t (month-end on MarketHeist)
- max Vₛ: the highest value up to and including period t

**Ulcer index**

```
UI = \sqrt{\frac{1}{N} \sum_{t = 1}^N R_t^2}
```

where:

- UI: Ulcer index, in percentage points
- N: number of periods in the window, including those at a new high (Rₜ = 0)
- Rₜ: percentage drawdown at period t

It is the quadratic mean of the drawdown curve. A portfolio that never falls below a previous high has UI = 0.

**Ulcer performance index (Martin ratio)**

```
UPI = \frac{R_p - R_f}{UI/100}
```

where:

- UPI: Ulcer performance index
- Rₚ: annualized return of the portfolio (MarketHeist uses CAGR)
- R_f: risk-free rate (zero on MarketHeist)
- UI: Ulcer index in percent, so UI / 100 is a fraction

## Worked example

Gold (GLD) and the S&P 500 (SPY), month-end values from Dec 2004 to Sep 2026, about 22 years.

On maximum drawdown alone, gold looks like the milder holding: its deepest decline was -42.9%, against -50.8% for the S&P 500.

The two declines had very different shapes. The S&P 500 fell from Oct 2007 to Feb 2009, 16 months, and regained its old high 37 months after the bottom. Gold slid from Aug 2011 to Dec 2015, 52 months of decline, and needed another 55 months to recover.

Gold is in another decline as of Sep 2026: it stands 21.3% below its Feb 2026 high, and the lab's drawdown chart ends inside that slump. The Ulcer index counts every month of it, so a decline that is still running keeps adding to the figure.

The Ulcer index registers the difference. Gold's was 18.9 and the S&P 500's 11.7: a long, deep slump weighs more in the average than a sharp drop that recovers. Gold's longest stretch below a previous high lasted 106 months; the S&P 500's lasted 52.

Growth over the window was similar, 10.3% a year for gold and 10.9% for the S&P 500, so the Ulcer performance index separates them: 0.54 for gold against 0.94 for the S&P 500. Per unit of drawdown pain, the S&P 500 delivered more growth over these years.

Neither figure is a verdict on gold as a holding. Gold has at times risen when stocks fell, which is one reason portfolios hold it beside stocks; measured on its own, its path in this window included one long slump. Measured by depth alone it looks calmer than stocks, and measured by depth and time together it does not.

Data through Sep 2026. Reproduce id: 98f6a1376dbf220c (this guide, its lab setup and the data month).

## How MarketHeist computes it

- **Data**: Monthly total returns (dividends reinvested). Funds younger than the period shown are extended backward with older funds, spliced on returns, not prices.
- **Window**: The worked example and the lab use the common window of the two portfolios compared, Dec 2004 to Sep 2026 (262 months), ending at the data month of this page. Another pick in the lab is read over its own common window.
- **Portfolio streams**: A fund is its proxy-extended monthly return stream. A built-in portfolio is read as the MarketHeist MCP reads it: its composed stream with its own rebalancing rule and overlay. A custom mix is rebalanced yearly.
- **Drawdown**: The percentage below the highest month-end value so far, from a value rebased to 1 at the start of the window. An episode runs from the month of a high until the value regains that high; the Ulcer index is the root mean square of the monthly drawdowns in percent, and time underwater counts every month below a high.
- **Drawdown curve**: Month-end value from monthly total returns, divided by the running peak, minus one. The running peak starts at the end of the first month of the window and is never reset. (`drawdown` in packages/portfolio/engine/metrics.ts)
- **Ulcer index**: √(mean of (100 · drawdown)²) over every month of the window, months at a new high included as zeros. Reported in percent units. This is Martin's whole-period form; charting platforms often use a rolling version over the last 14 periods instead, with the peak also taken over those 14 periods, which gives a different and much more volatile number. (`ulcerIndex` in packages/portfolio/engine/metrics_extra.ts)
- **Ulcer performance index**: CAGR divided by the Ulcer index as a fraction (UI / 100), with a risk-free rate of 0. Martin subtracted the Treasury-bill return; at a zero rate the figure is a return-per-pain ratio rather than an excess-return one. (`cagr` in packages/portfolio/engine/metrics.ts)
- **Longest time underwater**: The longest run of consecutive months with a drawdown below −1e-12, including a stretch still open at the end of the window. (`longestUnderwaterMonths` in packages/portfolio/engine/metrics_extra.ts)
- **Frequency**: Monthly. The index is often computed on daily or weekly closes elsewhere; month-end data miss falls that reverse within a month, so a monthly Ulcer index is usually somewhat lower than a daily one for the same fund.
- **In the app**: The portfolio report, the compare page and the MCP tools report the same whole-window Ulcer index, and trailing values (1 to 30 years, where the history is long enough) computed the same way inside each trailing window. (`trailingMetrics` in packages/portfolio/engine/windows.ts)
- **Engine functions**: `drawdown` (packages/portfolio/engine/metrics.ts), `drawdownEpisodes` (packages/portfolio/engine/analytics.ts), `ulcerIndex` (packages/portfolio/engine/metrics_extra.ts), `longestUnderwaterMonths` (packages/portfolio/engine/metrics_extra.ts), `metricsFromReturns` (packages/portfolio/engine/portfolio.ts)

## Ulcer index compared with its neighbours

Ulcer index, maximum drawdown, volatility and the ratios built on them

| Measure | Counts rises as risk | Depth | Duration | Return-per-risk ratio |
| --- | --- | --- | --- | --- |
| Volatility | Yes | Indirectly | No | Sharpe ratio |
| Downside deviation | No | Monthly losses only | No | Sortino ratio |
| Maximum drawdown | No | The single worst point | No | Calmar ratio |
| Ulcer index | No | Every month below a high, squared | Yes | Ulcer performance index (Martin ratio) |
| Longest time underwater | No | No | The single longest stretch | None |

## Limitations

- The value depends on where the window starts: the running peak begins at the first month, so a series that starts just after a crash looks calmer than one that starts just before it.
- Squaring makes the index sensitive to the deepest episode; one long, deep slump can dominate a long history.
- It is a backward-looking summary of one path and says nothing about how likely a future slump is.
- Month-end data understate falls that reverse within a month.
- There is no single convention. Whole-period and rolling 14-period versions, daily, weekly and monthly data, all give different numbers, so compare Ulcer indexes only when they were computed the same way.

## Frequently asked questions

**What is the Ulcer index?**

A downside risk measure: the square root of the average squared percentage drawdown from the running peak. It is low for portfolios that rarely fall below a previous high, or recover quickly, and high for ones that spend long periods well below it.

**What is a good Ulcer index?**

There is no universal threshold, because the value depends on the window, the data frequency and the asset mix. It is most useful for comparing portfolios over the same months, computed the same way.

**How is the Ulcer index different from maximum drawdown?**

Maximum drawdown is the single deepest fall. The Ulcer index averages every period's drawdown, squared, so it also reflects how long the portfolio stayed down and how often it fell.

**What is the Martin ratio?**

Another name for the Ulcer performance index: annualized return minus the risk-free rate, divided by the Ulcer index. MarketHeist reports it with a zero risk-free rate.

**Why is it called the Ulcer index?**

Peter Martin named it for the stress of watching an investment sit below its previous high. The index is meant to measure that experience rather than price swings in general.

## References

1. Martin, P. G. and McCann, B. B. (1989) The Investor's Guide to Fidelity Funds. John Wiley and Sons. Introduces the Ulcer index (developed by Martin in 1987) and the Ulcer performance index.
2. Young, T. W. (1991) Calmar Ratio: A Smoother Tool. Futures 20(1). The maximum-drawdown counterpart.
3. Chekhlov, A., Uryasev, S. and Zabarankin, M. (2005) Drawdown Measure in Portfolio Optimization. International Journal of Theoretical and Applied Finance 8(1). Average and conditional drawdown measures.

## Try it

App: https://marketheist.io/portfolio/compare

MCP prompt (MarketHeist MCP server, https://marketheist.io/mcp):

```
Using MarketHeist.io, compare GLD and SPY over their common window: max drawdown, Ulcer index, longest time underwater and the drawdown episodes
```

Historical simulation, not advice.
