VOLATILITY, DISPERSION & CANDLES

Ulcer index

A volatility measure that only counts the PAIN — how deep drawdowns went and how long they lasted.

spec id: ulcerlength (default 14)

What does Ulcer index measure?

A volatility measure that only counts the PAIN — how deep drawdowns went and how long they lasted. Upside volatility does not register.

How is Ulcer index calculated?

For each of the last 14 candles, work out how far below the window's running peak the close was, as a percentage. Square those, average them, and take the square root — so a long, deep slump scores far worse than a brief dip.

Written by reading the engine’s real computation, not a textbook — where the two differ, the page describes what actually runs.

How do I use Ulcer index in a bot?

In the builder, add an indicator of type ulcer (parameters: length, default 14). Its value becomes an operand you can compare in any entry or exit rule. The engine grades the whole rule honestly: real fills, no look-ahead, half the history held back.

Related indicators

Or browse all 158 indicators in the full library.

Build a bot that trades on Ulcer index — the first backtest is free.

Run a free backtest