Black Friday great discounts start today Learn more
+1 888 340 6572

Miscellaneous > Ulcer Index

Article/Author: Omega Research Inc., 1997

Download: ULCER.ELA

Category: Indicator > Miscellaneous

Description:

The Ulcer Index is a measure of the stress level related to an investment’s market behavior. It uses price retracements to measure the "stressfulness." This is done by comparing recent price action with past price action.

Usage:

As stated by Peter Martin and Byron McCann, "the higher an investment's Ulcer Index, the more likely investing in it will cause ulcers or sleepless nights."




Inputs:

Price - Specifies the price used to calculate the Ulcer Index
Length - Number of bars of data to be included in the calculation of the Ulcer Index
SafeLevel - The level above which the Ulcer Index is considered to be high

EasyLanguage Code:
INPUTS: PRICE(CLOSE), LENGTH(20), SAFELEVEL(5);

VARIABLES: UI(0);

UI = ULCERINDEX(PRICE, LENGTH);

PLOT1(UI, "ULCERINDEX");
PLOT2(SAFELEVEL, "SAFETYLEVEL");

IF PLOT1 > PLOT2 THEN
ALERT("THE SAFE LEVEL HAS BEEN EXCEEDED.");