How Is the Ulcer Index Calculated? Drawdown Risk and Strategy Comparison

 / 
2

Calculating the Ulcer Index takes only three steps, but its value is not in the formula itself — it is that it also counts "how long the drop lasted" as part of risk. Max drawdown only records the worst single point. A strategy that drops 30% from its high and then recovers immediately, and one that drops 30% and then stays flat for half a year before recovering, both show a max drawdown of 30%. The Ulcer Index will score the second one higher, because every trading day below the previous high is included. The longer the duration, the larger the accumulated penalty. When comparing strategies, this difference directly determines whether you select a strategy that "drops less" or one that "drops less and recovers faster."

OKX Exchange
A leading global cryptocurrency platform,suitable for both beginners and experienced traders.
New user benefit: 20% off trading fees upon registration!!

Formula: first calculate drawdown, then square and average, finally take the square root

Using a period length N (commonly 14) as an example, for each period i:

Step 1: Calculate the percentage drawdown. Take the current closing price, subtract the highest closing price over the past N periods, divide by that highest price, and multiply by 100. If the current period is the highest price, the drawdown is 0. If it is below the previous high, the drawdown is negative.

Step 2: Square, sum, and average. Square each of the N drawdown values, sum them, and divide by N. Squaring makes deep drawdowns carry much more weight than shallow drawdowns.

Step 3: Take the square root. Take the square root of the average, and the result is the Ulcer Index.

In one sentence: the Ulcer Index is the root mean square of drawdown depth. Its calculation is similar in form to standard deviation, but the difference is that standard deviation uses how much returns deviate from the mean, while the Ulcer Index uses how much price deviates from the previous high, and it only counts downward deviation.

Parameter choice: 14 is the default, but comparisons must use the same value

StockCharts and most technical analysis platforms default to 14 periods. There is no magic in this number; it is simply kept consistent with the default window of indicators such as RSI so they can be placed on the same chart.

What really affects the result is consistency between period length and price frequency. If you calculate BTC's Ulcer Index using daily candles and ETH's Ulcer Index using 4-hour candles, then compare the two numbers, the comparison is meaningless. Different time scales distort both the duration and depth of drawdowns. When comparing strategies, use the same N, the same time frame, and the same price type (the treatment of closing prices or high/low prices must be consistent).

Cross-strategy comparison: what the Ulcer Index captures beyond max drawdown

Suppose there are two strategies, both backtested over one year, and both have a max drawdown of 25%.

Strategy A: drops to -25% in month 3, recovers to the previous high in month 4, and then keeps rising. Strategy B: drops to -25% in month 2, then stays below the previous high, fluctuating until month 11 before recovering.

Max drawdown gives these two strategies exactly the same score. The Ulcer Index will clearly separate them: Strategy B has drawdown values included in the squared sum for more than nine months, while Strategy A only has about one month. As a result, Strategy B's Ulcer Index is much higher than Strategy A's.

The practical meaning of this difference is that Strategy B ties up your capital and attention for much longer. Your money is stuck and cannot move, or you need to endure the psychological pressure of floating losses for months. The Ulcer Index quantifies this "time cost." R language documentation also explicitly states that this method "penalizes managers who take time to recover to previous highs."

If you want a more refined comparison of return versus drawdown, you can use the Martin Ratio (UPI): subtract the risk-free return from the strategy return, then divide by the Ulcer Index. Its difference from the Sharpe ratio is that the denominator uses the Ulcer Index instead of standard deviation. Standard deviation treats upward volatility as risk, while the Ulcer Index only penalizes declines and the duration of drawdowns. For trend-following or long-only strategies, this denominator is closer to the risk you actually feel.

Common mistakes when using the Ulcer Index

Treating it as a timing signal. The Ulcer Index does not produce buy or sell points. It measures "how uncomfortable it is to hold this asset or strategy," not "when to enter or exit." A high Ulcer Index only means that past drawdowns were deep or lasted a long time. It does not tell you whether the market will rebound or continue falling next.

Directly comparing absolute values across assets without context. A highly volatile small-cap coin will naturally have a higher Ulcer Index than BTC. That does not mean it is "too dangerous to touch"; it only means its drawdown characteristics are more violent. If you are comparing different asset classes, you need to recognize the difference in volatility baselines. If you are comparing several strategies within the same asset class, the relative ranking of the Ulcer Index is what matters.

Ignoring the effect of the calculation window on results. An Ulcer Index calculated with 14 periods and one calculated with 50 periods cannot be directly compared. The longer the window, the more historical drawdowns are included, and the value is usually higher. When comparing strategies, first confirm that you are using the same N.

Completion standard

It is not "you calculated a number," but rather: under the same period length and price frequency, you can list the Ulcer Index of several strategies and know whether the ranking differences come from deeper drawdowns, longer drawdowns, or both. If you only need to know "how bad the worst case is," max drawdown is enough. If you care about "how long your money is stuck," or you are comparing two strategies with similar max drawdowns but different recovery speeds, the Ulcer Index provides information that max drawdown does not. First calculate the Ulcer In dex of the strategies you hold, and look at it together with max drawdown. The larger the gap between the two, the more that strategy's "discomfort" comes from grinding sideways rather than falling.

OKX Exchange
A leading global cryptocurrency platform,suitable for both beginners and experienced traders.
New user benefit: 20% off trading fees upon registration!!

References

  1. StockCharts ChartSchool·Ulcer Index, page published or updated: 2024-08-12; verified: 2026-10-18.
  2. Trading Technologies·Ulcer Index, page undated; verified: 2026-10-18.
  3. R Project·calculate the Ulcer Index (JFE), page undated; verified: 2026-10-18.
  4. GitHub·Learn-Quant: drawdown_analysis.py, page published or updated: 2026-05-10; verified: 2026-10-18.
  5. R Project·calculate the Ulcer Index (PerformanceAnalytics), page undated; verified: 2026-10-18.
  6. Bitget·Risk meter in the crypto market: how the Ulcer Index is useful, page published or updated: 2026-06-28; verified: 2026-10-18.
  7. TradingView·Martin Ratio Asset Screener, page published or updated: 2026-08-26; verified: 2026-10-18.