Skip to content
TraderCalcs.io

Ulcer Index Calculator

Measure drawdown depth and duration together, penalising long periods underwater rather than single bad days.

The ulcer index combines drawdown depth and duration in a single figure: how much of a record was spent below its own high-water mark, and how far below. This ulcer index calculator walks an equity curve, computes the percentage decline from the running peak at every single point, squares those declines, averages them across the whole record and takes the square root. Peter Martin introduced the measure in 1987, and the name is meant literally: it describes how uncomfortable a curve was to hold rather than how far it travelled.

Formula: ulcer index = sqrt(mean of squared percentage drawdowns from the running peak)

Your figures

Equity curve

Your account value, an index level or a price, in order and oldest first. Any consistent unit will do: the index depends on the shape of the curve, not its scale.

Value 1
Value 2
Value 3
Value 4
Value 5
Value 6

Optional — your own annualised return over the same record, which turns the ulcer index into the Martin ratio. Nothing here can derive it, because the series carries no dates.

Results

Ulcer index

8.54%

root mean square of every drawdown in the record

Maximum drawdownThe deepest single decline from a prior peak, taken from the same function the maximum drawdown calculator uses. The ulcer index can never exceed it.
15.18%
Average drawdownThe mean across every period, including the zeros at new highs. Always at or below the ulcer index, because squaring weights the deep periods more heavily than an average does.
5.80%
Time underwater3 of 6 periods sat below a prior peak.
50.00%
Longest run below the peakThe longest unbroken stretch of periods without a new high.
3
Periods in the record
6
Martin ratio+12.00% annualised divided by the ulcer index. Return per unit of drawdown, on the figure you supplied.
1.4050

What this means

Across 6 points the curve spent 3 of them below a prior peak — 50.00% of the record — with the deepest decline reaching 15.18% and the longest unbroken stretch without a new high running 3 periods. Squaring each period's drawdown, averaging over every period and taking the square root gives 8.54%. That sits between the 5.80% average drawdown and the 15.18% maximum, and it always will: squaring pulls the figure towards the deep periods, but it cannot pull it past the deepest one. Two records with the same maximum drawdown separate here, because the one that stayed down contributes a large square at every period it spent underwater.

  • The mean inside the ulcer index divides by the plain count of periods, n, rather than the n − 1 used for return standard deviations. These are distances from zero rather than deviations about an estimated mean, so there is no estimated centre to pay a degree of freedom for — which is how Peter Martin defined it.
  • The ulcer index is conventionally quoted as a bare number. It is shown here in percentage points because that is what it is, the root mean square of percentage drawdowns, and it makes it directly comparable with the maximum drawdown above.
  • Measured only on the values entered. Anything that happened between two entries is invisible to the calculation, so more frequent values give a more faithful figure.
  • Every point counts equally, so the figure depends on how often the series is sampled. Daily values and monthly values over the same record give different indices, and comparing two curves means sampling both the same way.
  • The Martin ratio uses the annualised return you entered. Nothing here checks it against the curve, because the series carries no dates to annualise over.

Ulcer index: 8.54%

The link reopens this calculator with the same numbers. Nothing you enter is sent to a server.

About the Ulcer Index calculation

Maximum drawdown reports one moment. A curve that fell 30% and recovered the following month, and one that fell 30% and stayed there for three years, share a maximum drawdown and were not remotely the same experience. Because this index averages over every period instead of taking a maximum, the second contributes a large squared decline at every point it spends underwater while the first contributes one two or three times.

Entering an annualised return alongside the curve produces the Martin ratio, published in some sources as the ulcer performance index: that return divided by the ulcer index, which is the same idea as the Calmar ratio with a depth-and-duration measure in the denominator instead of a single worst drawdown. Nothing here derives the return, because the series carries no dates: it is a figure you supply, and the result panel says so.

Ulcer Index formula

walking the series, tracking the running peak:
  peak_i = the highest value up to and including point i
  D_i    = (peak_i − value_i) ÷ peak_i × 100

ulcer index = √( Σ D_i² ÷ n )

Martin ratio = annualised return ÷ ulcer index
peak_i
The running high-water mark. It only ever moves upward, so every new high resets the drawdown at that point to zero.
D_i
The percentage decline from that peak at point i. Exactly zero at a new high, never negative, and always below 100.
n
Every point in the record, including those sitting at a new high. Those contribute zeros to the sum, and the zeros are the point.
Martin ratio
Annualised return per unit of ulcer index — the same construction as a Sharpe ratio with drawdown pain in place of volatility.

Squaring is what turns a duration measure into a depth-and-duration measure. A plain average of the drawdowns would treat a hundred periods at 2% as identical to ten periods at 20%; squaring makes the second ten times heavier, because 20² is 400 against 2²'s 4. The square root at the end brings the answer back into percentage points so it can be read directly against the maximum drawdown reported beside it.

The zeros at new highs are included on purpose. They are what makes the index sensitive to how much of the record was spent underwater rather than only to how deep the holes went: a curve that keeps making new highs dilutes its own squared drawdowns towards zero, while one that made two highs in five years has almost nothing to dilute them with.

The mean divides by n rather than n − 1, unlike every return standard deviation elsewhere on this site. Those are deviations about a mean estimated from the same data, which costs a degree of freedom; these are distances from a running peak, which is observed rather than estimated. A drawdown of nothing is a real, measured nothing, and Martin's original definition divides by n for exactly that reason.

The result always sits between the average drawdown and the maximum, and it cannot escape either bound. Squaring pulls it towards the deepest periods, so it is at least the average; but a root mean square of numbers none of which exceeds the maximum cannot exceed the maximum either. Where it lands between the two is the useful part — near the maximum means the curve lived down there, near the average means it visited briefly.

Ulcer Index: a worked example

An equity curve recorded at 10,000 → 11,200 → 9,800 → 9,500 → 10,400 → 11,500, with a 12% annualised return entered beside it.

  1. Running peak at each point10,000 · 11,200 · 11,200 · 11,200 · 11,200 · 11,500
  2. Drawdown at each point0% · 0% · 12.5000% · 15.1786% · 7.1429% · 0%
  3. Sum of the squares156.25 + 230.3890 + 51.0204 = 437.6594
  4. Mean over all six points437.6594 ÷ 6 = 72.9432
  5. Ulcer index√72.9432 = 8.54%
  6. Martin ratio12 ÷ 8.5407 = 1.4050

8.54%, sitting between the 5.80% average drawdown and the 15.18% maximum, as it always must. Three of the six points were below a prior peak — 50% of the record, in one unbroken run of three. Squaring is why the index lands closer to the maximum than to the average: the two deepest points carry 88% of the sum of squares between them — 386.6394 of 437.6594 — while making up a third of the record.

How to use the Ulcer Index calculator

  1. Enter your equity values in order, oldest first. Any consistent unit works, because every drawdown is a ratio to a running peak — an account in dollars, an index level and a raw price series give the same answer for the same shape.
  2. Sample the series at one interval and keep to it. Daily values and monthly values over the same record produce different indices, and a figure from one is not comparable with a figure from the other.
  3. Add rows for as many points as you have, up to sixty. More points capture more of what happened between the ones already entered, and blank rows are ignored.
  4. Optionally enter your own annualised return over the same record to use the page as a Martin ratio calculator. That return cannot be checked against the curve, because the series carries no dates to annualise over.
  5. Read the index against the maximum drawdown and the average drawdown beside it. The three together say considerably more than any one of them does alone.
  6. Check time underwater and the longest run below the peak. Those two rows are the duration half of what the index compresses into a single figure.

Limitations of the Ulcer Index calculator

Every calculation makes assumptions. These are the ones that matter here.

  • The figure depends on how often the series is sampled. The same record at daily and at monthly resolution gives two different indices, so comparing two curves means sampling both the same way.
  • Only the values entered are seen. A trough between two recorded points never happened as far as the calculation is concerned, which is why monthly data flatters a curve that fell and recovered inside a single month.
  • Deposits and withdrawals distort an equity curve badly. A withdrawal reads as a drawdown and a deposit resets the peak, so a funded account needs a return-based series rather than a raw balance one.
  • There is no established scale for what a given index means. It is comparable between two curves measured identically, and close to meaningless quoted in isolation with nothing beside it.
  • The Martin ratio uses the annualised return you supply and nothing here validates it. An overstated return produces an overstated ratio without any complaint from the calculation.
  • A short record contains too few peaks and troughs for the average to settle. Across twenty or thirty points the index is largely a description of whichever decline happened to fall inside the window.

Frequently asked questions about Ulcer Index

Why use the ulcer index rather than maximum drawdown?

Maximum drawdown records a single moment and discards everything else, so it cannot distinguish a sharp fall that recovered quickly from an identical fall that persisted for years. The ulcer index averages across every period, so as an underwater equity measure it counts time spent below the peak as well as the depth reached. Both are reported here together, because knowing the worst point and knowing how typical it was are different pieces of information.

Why divide by n when a standard deviation divides by n − 1?

Because there is no estimated mean to pay a degree of freedom for. A sample standard deviation subtracts a mean computed from the same data, and n − 1 corrects for that. Drawdowns are measured from a running peak that is observed directly, and a drawdown of zero is a real observation rather than a residual, so dividing by the plain count of periods is correct. Martin's original definition does the same.

Can the ulcer index be larger than the maximum drawdown?

No, and it never will be. It is the root mean square of a set of numbers none of which exceeds the maximum, and a root mean square is bounded above by the largest value it averages. It reaches the maximum only in the degenerate case where every single period sat at exactly the deepest drawdown, which no real curve does because the first point is always at its own peak.

What counts as a high or low ulcer index?

There is no reference scale, and none is offered here. The number is meaningful when two curves are measured over the same period at the same sampling interval, and largely meaningless on its own — an index of 8% on daily data and 8% on monthly data over the same record describe different things. Compare it against the maximum drawdown and the average drawdown shown alongside, which give it context the number cannot carry by itself.

What does the Martin ratio actually measure?

Return per unit of drawdown pain, in the same way a Sharpe ratio measures return per unit of volatility and a Calmar ratio measures it per unit of worst drawdown. Because the denominator weights long shallow declines as well as short deep ones, a curve that recovers quickly scores better than one with the same worst decline that took years to climb out. Like every ratio built on a short record, it is dominated by whichever period happened to be sampled.

Does it matter whether I enter dollars, pounds or index points?

No, provided the unit is consistent down the column. Every drawdown is a percentage of the running peak, so multiplying the entire series by any positive constant leaves every drawdown unchanged and the index identical. That is why the calculator has no currency selector: nothing it reports is denominated in money.

Last reviewed . See our methodology and editorial policy.

More performance calculators