+1 888 340 6572

NewHPI

Article/Author: Omega Research Inc., 1997

Download: FUNCTION-NEWHPI.ELA

File Includes: Function - NewHPI

Description: This is another function for HPI (Herrick Payoff Index)
NOTE: THIS FUNCTION USES OPENINT, SO IT IS ONLY VALID FOR DAILY DATA
ALSO: HPI IS VERY LARGE NUMBER SO FOR PLOTTING IT WE SHOULD DIVIDE BY 1,000,000

EasyLanguage Code:

INPUT : MULT(NUMERICSIMPLE), FACTOR(NUMERICSIMPLE);
VARS : IDIFF(0),IMIN(0),K(0);


IDIFF = 2 * ABSVALUE(OPENINT[0] - OPENINT[1]);
IF OPENINT[0] < OPENINT[1] THEN IMIN = OPENINT[0] ELSE IMIN = OPENINT[1];

IF IMIN > 0 THEN
K = ((HIGH + LOW) / 2) - ((HIGH[1] + LOW[1]) / 2) * MULT * VOLUME * (1 + IDIFF / IMIN);

IF CURRENTBAR <= 1 THEN NEWHPI = K
ELSE
NEWHPI = NEWHPI[1] + ((K - NEWHPI[1]) * FACTOR);