The Ulcer Index (UI) is a risk measurement tool superior to the standard deviation because it differentiates between rising returns and losses. Investors do not view a set of rising returns as a negative sign of volatility, after all; one of the investor goals is to avoid losses.
It is the square root of the average of the squared retracements from the latest high.
GT::Indicators::UI->new()