UlcerIndex (Function)
The UlcerIndex function is a measure of the stress level related to market conditions.
Function
UlcerIndex(Price, Length)
Returns (Double)
A numeric value containing the Ulcer Index for the current bar.
Parameters
Name |
Type |
Description |
Price |
Numeric |
Specifies which bar value (price, function, or formula) to be considered. |
Length |
Numeric |
Sets the number of bars to consider. |
Remarks
The Ulcer Index uses retracements to measure the "stressfulness" associated with the instrument at the current time. As stated by Peter Martin and Byron McCann, "the higher an investment’s UI, the more likely investing in it will cause ulcers or sleepless nights."
Example
Assigns to Value1 the Ulcer Index calculated over the past 14 closing prices:
Value1 = UlcerIndex(Close, 14);
Assigns to Value2 the Ulcer Index calculated over the past 21 High prices:
Value2 = UlcerIndex(High, 21);