Ulcer Index Pass Node

Ulcer Index — Series Input

IndicatorVolatilityPass

Overview

The Ulcer Index Pass Node applies the Ulcer Index algorithm to any upstream numeric series. The Ulcer Index measures downside volatility — specifically, the depth and duration of drawdowns from recent highs. Unlike standard deviation (which treats up and down moves equally), the Ulcer Index only penalises declines, making it a one-sided risk measure beloved by long-only traders.

The pass variant accepts a { values, timestamps } input, enabling Ulcer Index on indicator outputs, portfolio equity curves, or any custom data stream, not just closing prices.

Formula

Percent Drawdown (each bar)
D = 100 × ( value − maxHigh ) / maxHigh
where maxHigh is the highest value in the lookback window
Ulcer Index
UI = √[ Σ D² / period ]
Only downward deviations contribute (D is non-positive when below the high). Upward breakouts to new highs produce D = 0 and do not increase the index.

Parameters

ParameterTypeDefaultDescription
periodnumber14Lookback window for both the rolling high and the RMS drawdown calculation.

Inputs & Outputs

SlotDirectionTypeDescription
inputInput{ values, timestamps }Any upstream numeric series (must be positive for meaningful drawdown calculation)
valuesOutput(number | null)[]Ulcer Index values (≥ 0); nulls during warm-up
timestampsOutputnumber[]Unix timestamps aligned to the input series

Use Cases

Equity Curve Risk

Apply to a portfolio NAV or equity curve to measure drawdown risk in a single indicator.

Downside-Only Volatility Filter

Use Ulcer Index instead of ATR when you only care about adverse price moves and want to ignore upside volatility.

Martin Ratio

Divide annualised return by Ulcer Index to compute the Martin Ratio — a risk-adjusted return metric superior to Sharpe for long-only strategies.

Tips & Best Practices

📉 Positive Series Only

Ulcer Index is defined for positive series (prices, NAV). Applying it to zero-crossing oscillators may give unintuitive results.

⚡ vs ATR

ATR treats upside and downside equally; Ulcer Index only measures drawdown severity. Use Ulcer Index when upside volatility is not a risk.

🔗 vs Standard Node

If the data comes directly from a stock source, use the standard Ulcer Index node. Use this Pass node for any other numeric series.

Related Indicators