Systemicbeta

Ulcer Index

systemic:core-uiIndicators

Inputs

NameTypeDescription
WindowWhole numberThe number of bars the Ulcer Index looks back over.
PriceNumber seriesThe price series to measure drawdowns on, usually closing prices.

Outputs

NameTypeDescription
UINumber seriesThe Ulcer Index at each bar: the root-mean-square percentage drawdown of the price over the window.

Cost

6
credits per run
1,000
bars

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.

UI=∑i=1nRi2nUI = \sqrt{\frac{\sum_{i=1}^{n} R_i^2}{n}}

Where RiR_i = percentage drawdown of the price from its highest value in the last nn bars, and nn = 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 ValueInterpretation
< 5Low stress — shallow drawdowns
5-10Moderate drawdown risk
10-20Elevated volatility
> 20High 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:

MeasureCaptures
Standard DeviationAll price movement
Ulcer IndexOnly 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:

UPI=ReturnUlcer IndexUPI = \frac{Return}{Ulcer\ Index}

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

MetricFocusTreats Up/Down
Ulcer IndexDrawdownsDownside only
Std DevAll volatilityEqually
Max DrawdownWorst declineSingle event
Sortino RatioDownside deviationDownside 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:

ScenarioOutput
Closed-market gapEmpty 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 emptyEvery 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

DimensionStocksCryptoNotes
Popularity5/104/10Niche but respected; more common in fund analysis than retail trading
Reliability7.5/106.5/10Excellent for measuring downside risk; crypto's extreme volatility causes higher UI readings
Complexity4/104/10Simple idea (drawdowns squared and averaged); easy to interpret
Versatility6/105/10Excellent for risk comparison and portfolio construction; less applicable as a trading signal
Recent Interest5/104/10Steady adoption in risk-adjusted analysis; growing interest post-2022 market declines
Rendering diagrams...
© 2026 WanoLabs. All rights reservedBeta v0.1.5