HMA - Hull Moving Average

Description

The Hull Moving Average, invented by Alan Hull, is a fast-working moving average that gets rid of almost all delays/lags (zero lag). The calculation is carried out using several weighted moving averages, thereby partially reducing the smoothing effect. Hull’s methodology uses square roots of the period instead of the actual period itself.

Interpretation

The same interpretations as for the moving averages apply to the HMA, the only major distinction being the reduced lag. See Moving Averages.

Usage

HMA(int period)
HMA(IDataSeries InSeries, int period)
HMA(int period)[int barsAgo]
HMA(IDataSeries InSeries, int period)[int barsAgo]

Return value

double

When using this method with an index (e.g. HMA(21)[int barsAgo] ), the value of the indicator will be issued for the referenced bar.

Parameters

inSeries Input data series for the indicator

period Number of bars included in the calculations

Visualization

Calculation

double value1 = 2 * WMA(InSeries, (int)(Period / 2))[0];
double value2 = WMA(InSeries, Period)[0];
diffSeries.Set(value1 - value2);
Value.Set(WMA(diffSeries, (int) Math.Sqrt(Period))[0]);

Example

//Output the value for the HMA
Print("The current HMA value is " + HMA(21)[0]);

Last updated