Ulcer Index
systemic:core-uiIndicatorsInputs
| Name | Type | Description |
|---|---|---|
| Window | Whole number | The number of bars the Ulcer Index looks back over. |
| Price | Number series | The price series to measure drawdowns on, usually closing prices. |
Outputs
| Name | Type | Description |
|---|---|---|
| UI | Number series | The Ulcer Index at each bar: the root-mean-square percentage drawdown of the price over the window. |
Cost
0.207 + 0.00565·n credits for n bars, rounded up. The marks are each plan's limit of bars.
The Ulcer Index measures downside volatility: how deep drawdowns are and how long they last. Unlike standard deviation, it looks only at price declines, so it measures the pain of holding an investment.
Where = percentage drawdown of the price from its highest value in the last bars, and = Window.
How It Works
flowchart TD
subgraph Input["Price Series"]
P["Closing Prices"]
end
subgraph Calc["Calculation Steps"]
HH["Track highest price in the window"]
DD["Drawdown = (High - Price) / High × 100"]
SQ["Square each drawdown"]
AVG["Average of squared drawdowns"]
SQRT["Square root"]
end
subgraph Output["Result"]
UI["Ulcer Index"]
end
P --> HH --> DD --> SQ --> AVG --> SQRT --> UI
Interpreting UI
| UI Value | Interpretation |
|---|---|
| < 5 | Low stress — shallow drawdowns |
| 5-10 | Moderate drawdown risk |
| 10-20 | Elevated volatility |
| > 20 | High stress — deep/prolonged drawdowns |
flowchart LR
subgraph Stress["Ulcer Index Levels"]
LOW["<5<br/>Low stress"]
MOD["5-10<br/>Moderate"]
HIGH["10-20<br/>Elevated"]
VHIGH[">20<br/>High stress"]
end
LOW --> MOD --> HIGH --> VHIGH
Why Ulcer Index?
Traditional volatility measures (like standard deviation) treat moves up and down equally. For investors they are not equal:
| Measure | Captures |
|---|---|
| Standard Deviation | All price movement |
| Ulcer Index | Only drawdown pain |
Most investors don't mind upside volatility — they worry about losses.
Applications
1. Risk Assessment
Compare UI across assets to see which ones have had deeper and longer drawdowns.
2. UPI (Ulcer Performance Index)
A risk-adjusted return metric:
Higher UPI = more return per unit of drawdown.
3. Position Sizing
Assets with a lower UI can justify larger position sizes in a portfolio.
UI vs Other Risk Metrics
| Metric | Focus | Treats Up/Down |
|---|---|---|
| Ulcer Index | Drawdowns | Downside only |
| Std Dev | All volatility | Equally |
| Max Drawdown | Worst decline | Single event |
| Sortino Ratio | Downside deviation | Downside only |
Advantages
- Investor-aligned — Measures what hurts portfolios
- Captures duration — Long drawdowns raise the index more
- Risk-adjusted returns — Basis of the UPI metric
- Comparable — Works across asset classes
Disadvantages
- Backward-looking — Based on historical drawdowns
- Window sensitive — Depends on the Window you choose
- Less known — Not as standard as the Sharpe ratio
- Needs a full window — No value until Window bars have a price
Further Reading
Missing Data
An empty input bar (closed market or missing data) gives an empty output bar. It is never filled. The calculation uses only the bars that have a price, so a window of 14 means 14 bars with a price:
| Scenario | Output |
|---|---|
| Closed-market gap | Empty at that bar. The bars around the gap count as neighbours (Monday follows Friday) |
Warm-up (fewer than window bars with a price so far) | Empty |
| All bars empty | Every output bar is empty |
Indicator Assessment
The chart below places the Ulcer Index by complexity (how easy it is to understand and use) and reliability (how consistent its signals are across market conditions). Higher points are more reliable. Points further left are less complex.
quadrantChart
title Ulcer Index Assessment
x-axis Low Complexity --> High Complexity
y-axis Low Reliability --> High Reliability
quadrant-1 Complex & Reliable
quadrant-2 Simple & Reliable
quadrant-3 Simple & Unreliable
quadrant-4 Complex & Unreliable
Stocks: [0.40, 0.75]
Crypto: [0.40, 0.65]
Assessment Breakdown
| Dimension | Stocks | Crypto | Notes |
|---|---|---|---|
| Popularity | 5/10 | 4/10 | Niche but respected; more common in fund analysis than retail trading |
| Reliability | 7.5/10 | 6.5/10 | Excellent for measuring downside risk; crypto's extreme volatility causes higher UI readings |
| Complexity | 4/10 | 4/10 | Simple idea (drawdowns squared and averaged); easy to interpret |
| Versatility | 6/10 | 5/10 | Excellent for risk comparison and portfolio construction; less applicable as a trading signal |
| Recent Interest | 5/10 | 4/10 | Steady adoption in risk-adjusted analysis; growing interest post-2022 market declines |