Volatility & bands

Ulcer Index · UI

A downside-only volatility measure that scores the depth and duration of drawdowns.

Works in most conditionsEngine-computed on a fixed sample series
14512096Rising = expanding, falling = fading
UI 8.43How to read UI on the chart — the callouts mark what to look for.

The formula

For each bar measure the percent the close sits below the highest close reached so far, square it so deep and long drawdowns dominate, average those squares across the lookback, then take the square root. Rising prices contribute zero — only declines register.

Ulcer Index = √( average of Drawdown² ), Drawdown = (Close − Highest Close so far) ÷ Highest Close so far × 100
Worked example
ClosePeak so farDrawdown %Drawdown²
1001000.00.0
95100−5.025.0
90100−10.0100.0
97100−3.09.0

Mean of squares = (0 + 25 + 100 + 9) ÷ 4 = 33.5 → UI = √33.5 ≈ 5.8

What it is

The Ulcer Index (UI) is a risk measure, not a buy-or-sell signal, and its memorable name captures its purpose: it scores how much stomach-churning pain an investment would have caused you to hold. It was developed by Peter Martin and Byron McCann and introduced in their book on fund investing. Ordinary volatility measures like standard deviation punish upside and downside equally, which is odd because nobody complains about their portfolio going up too fast. The Ulcer Index fixes that by looking only at drawdowns, the declines from prior peaks, and ignoring gains entirely. A low reading means the path was smooth with shallow, brief dips; a high reading means deep or prolonged declines that would have tested your nerves.

How it is calculated

For each bar in the lookback window, the calculation first finds the highest close reached so far up to that bar, then computes the percentage drawdown as one hundred times the current close minus that running maximum, divided by the maximum. Because the current close can never exceed a running maximum that already includes it, this figure is zero at new highs and negative during declines. Each of those percentage drawdowns is then squared, which does two things: it removes the negative sign and it disproportionately penalizes larger drawdowns, so a single deep decline hurts the score far more than several tiny ones. Those squared values are averaged across the window, and the square root of that average is the Ulcer Index. The squaring-then-rooting sequence is the same mathematical shape as a root-mean-square, which is why the index is sometimes described as the root mean square of drawdowns.

Reading it, step by step

Read the Ulcer Index as an absolute number where lower is always better and zero would mean price never once traded below a prior peak. There is no universal overbought or oversold threshold; instead you compare the reading across assets or across time. If asset A has a UI of 2 and asset B has a UI of 8 over the same window, B put holders through four times the drawdown discomfort. A rising Ulcer Index on a position you already hold is a live warning that drawdown risk is building and the recent path is getting rougher. Because it is drawdown-based, the index only moves up after declines are already underway, so it describes pain that has happened rather than predicting pain to come. Two investments can post the identical total return over a year yet have wildly different Ulcer readings, and that gap is exactly the insight the tool exists to provide.

Best timeframes

  • ScalpingNot usedneeds many bars
  • Day tradingRarely used
  • SwingDaily, 14position drawdown
  • PositionDaily / weekly, 14+its home turf

The Ulcer Index is a longer-horizon risk measure — it shines when comparing funds, systems or open positions over weeks and months, not for intraday timing.

Ulcer Index vs other risk measures

Ulcer IndexStd DeviationMax Drawdown
Counts upside as riskNoYesNo
Captures durationYesNoNo
MeasuresDrawdown painDispersionWorst single fall
Best useCompare painVolatilityWorst case

Common price-action setups

How the signal typically plays out on the chart.

Drawdown alarm

Price presses new highs but each dip prints a higher Ulcer Index — the advance is being held through deeper, longer pullbacks. Treat it as a cue to trail stops tighter or trim, not to add.

Tighten stops
Drawdown risk building
Healing drawdown

After a decline the Ulcer Index rolls over and falls back toward its baseline as price reclaims lost ground — the drawdown is mending and the position is stabilising.

Re-engage
Drawdown healing

Best timeframes and settings

The common default lookback is 14 periods, but the Ulcer Index is most meaningful over longer horizons because drawdowns take time to develop and resolve. On daily charts a 14-day window captures short-term pain, while investors comparing funds often use 14 months or a multi-year window to judge how uncomfortable a long-term holding really was. Lengthening the window smooths the reading and reflects structural, cycle-length risk; shortening it makes the index twitch with every minor dip. Because it is a portfolio and comparison tool more than a trading signal, position traders and long-term investors get more from it than scalpers or day traders, for whom intraday drawdowns are not the relevant risk. Match the window to your actual holding period, since a metric of monthly pain is irrelevant if you close every position by the bell.

When and where to use it

Use the Ulcer Index whenever you are choosing between investments that look similar on return but may differ sharply on the path they took to get there. It is ideal for ranking mutual funds, ETFs, trading systems, or strategy backtests on a pain-adjusted basis rather than raw performance. It also serves as a live risk monitor: watch it on an open long-term position and let a sustained rise prompt you to review your exposure. It is not a market-timing tool and will never tell you when to enter or exit a trade, so avoid using it to generate signals. It is most at home in the world of allocation, due diligence, and system evaluation, where the question is not when to trade but which thing is worth holding.

Strategies that use it

The primary application is the Martin Ratio, also called the Ulcer Performance Index, which divides an investment's excess return over the risk-free rate by its Ulcer Index, mirroring how the Sharpe ratio divides excess return by standard deviation. Ranking a set of funds by Martin Ratio surfaces the ones that delivered return with the least drawdown pain, which is often a very different list from ranking by raw return. A second use is system selection in backtesting: when two strategies show comparable profit, prefer the one with the lower Ulcer Index because it will be psychologically easier to trade and less likely to be abandoned during a drawdown. A third is a risk-off overlay: if a portfolio's rolling Ulcer Index climbs above a level you have predefined as your comfort limit, trim exposure until the path smooths out again.

Combining it with other indicators

The Ulcer Index complements standard deviation and historical volatility beautifully, because side by side they reveal whether an asset's total volatility is mostly upside noise or genuine downside pain. Pairing it with maximum drawdown gives both the single worst decline and the average ongoing drawdown discomfort, which together paint a fuller risk picture. On a chart, overlaying it with a trend tool such as a long moving average helps you see whether rising drawdown risk coincides with a trend actually breaking down. For system builders it sits well beside the Sharpe and Sortino ratios in a metrics table, adding a drawdown-shaped view that those return-to-volatility measures miss. It does not belong next to momentum oscillators for timing, because it answers a different question entirely: how much did this hurt, not when to act.

Where it fails

The Ulcer Index is backward-looking by construction, so it can only tell you about drawdowns that have already occurred and will lull you into complacency right before a fresh decline. It is entirely silent on direction and timing, and a trader who mistakes it for a signal generator will get nothing usable. Because it squares drawdowns, one extreme historical decline can dominate the reading long after conditions have changed, making the window choice critical. It also assumes the closing prices fed to it are clean; corporate actions, bad ticks, or survivorship bias in a fund comparison will distort it. The classic mistake is comparing Ulcer Indices computed over different window lengths or on assets with different price histories, which is not apples to apples. Use consistent windows, understand it as a rear-view risk gauge, and never expect it to time anything.

A worked example

Consider two funds that both returned exactly 10 percent over a year, with the risk-free rate at zero. Fund A drifted upward with only shallow pullbacks, its worst drawdowns rarely exceeding 2 percent, producing squared drawdowns that average to about 2.25 and therefore an Ulcer Index near 1.5. Fund B reached the same finish line but suffered a 20 percent decline that lasted several months before recovering, so its squared drawdowns average far higher, around 64, giving an Ulcer Index near 8. Now apply the Martin Ratio: Fund A scores 10 divided by 1.5, roughly 6.7, while Fund B scores 10 divided by 8, roughly 1.25. Despite identical returns, Fund A is more than five times better on a pain-adjusted basis, and the Ulcer Index is what let you see that the smoother path was the vastly superior holding.

Common mistakes

  • Using the Ulcer Index as an entry or exit trigger — it measures risk, it does not time the market.
  • Comparing UI values computed over different lookbacks or timeframes as if they shared a scale.
  • Judging an investment on return alone; two assets with equal returns can have very different UI.
  • Expecting an early warning — being drawdown-based, UI only rises after a decline is already under way.
  • Ignoring it in a backtest — a strategy with a great return but a high Ulcer Index may be untradeable in real life.