**Article/Author:**Aldo A. Palles, August 30, 1993

**Download:**hpicustom.ela

**File Includes:**

Indicator -

**HPICustom**

Function -

**HPICustom**

Function -

**K**

**Category:**Indicator > Miscellaneous

**Description:**

The Herrick Payoff Index is used to analyze futures and commodities. Because the Index uses open interest in its calculations, the security must contain open interest.

Briefly, the calculation of the Herrick Payoff Index involves computing the mean price for each day and then using this information to compute the difference in mean prices for each day. The flow of money into, or out of, the commodity is then computed by multiplying the change in the mean prices by the day's volume to arrive at a total change in dollars for the day. MetaStock Pro uses the dollar value of a one cent move (input by the user) to modify the "money flow" by changes in open interest. The daily values of the "modulated dollar amount" are then smoothed with an exponential moving average.

According to Herrick, the recommended input for "the value of a one cent move" is "100" for most commodities. The only exception is for Silver, which should be "50."

Before the Herrick Payoff Index is calculated, you will be prompted to enter a smoothing factor known as the "multiplying factor." The multiplying factor is part of a complex smoothing mechanism. However, the results are similar to the smoothing obtained by a moving average. For example, a multiplying factor of ten produces results similar to a 10-period moving average.

This indicator works according to the following formula: HPI = K[1] + (K - K[1])

Where K = ((M - M[1]) * C * V) * (1 +- ((I / 2) / G))

And

M = MedianPrice: (High + Low) /2

C = Value of a 1 cent move: PointValue

V = Volume

I = Absolute value of Close - Close[1]

G = The lesser of OpenInt and OpenInt[1]

The

**+**or

**-**sign is determined by the following criteria:

If M > M[1] then use the "+"

If M < M[1] then use the "-"

**Usage:**

The using of the Herrick Payoff Index involves visually comparing the action of the Index with the price while looking for divergences and convergences. An example divergence would be increasing prices while the Index is falling. An example convergence would be decreasing prices while the Index is rising.

**Indicator HPICustom ELA Code:**

PLOT1(HPICUSTOM,"HPI");

**Function HPICustom ELA Code:**

HPICUSTOM = K[1] + (K - K[1]);

**Function K ELA Code:**

IF MEDIANPRICE > MEDIANPRICE[1] AND MINLIST(OPENINT, OPENINT[1]) > 0 THEN

K = ((MEDIANPRICE - MEDIANPRICE[1]) * (POINTVALUE) * VOLUME) *

(1 + (ABSVALUE(CLOSE - CLOSE[1]) / MINLIST(OPENINT, OPENINT[1])))

ELSE

IF MINLIST(OPENINT, OPENINT[1]) > 0 THEN

K = ((MEDIANPRICE - MEDIANPRICE[1]) * (POINTVALUE) * VOLUME) *

(1 - (ABSVALUE(CLOSE - CLOSE[1]) / MINLIST(OPENINT, OPENINT[1])));