Hull Moving Average Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

Alan Hull designed his average to follow price closely without the jitter of a short average. The hull moving average indicator doubles a 10-bar weighted average, subtracts a 20-bar one, and smooths the result over four bars. The line bends quickly at turns, and the build flags each slope change.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 3: HMA, WMA(N/2)*2, WMA(N)
Alerts popup
Inputs 4

What the file declares

One line on price, nothing else by default.

`HMA` traces dodger blue at width 2.

`ShowComponents` can add the two helper lines.

`WMA(N/2)*2` is the doubled half-length average.

`WMA(N)` is the full-length average.

No other plots are drawn.

  • HMA: line, dodger blue, width 2
  • WMA(N/2)*2: plot, silver
  • WMA(N): plot, silver
hull moving average indicator: Hull moving average on price, EURUSD H1.
Hull moving average on price, EURUSD H1.

Working through the maths

Two weighted averages

`HmaPeriod` `20` gives a 20-bar weighted average and a 10-bar one. The build doubles the short one and subtracts the long one.

Final smoothing

A second weighted average smooths that difference over the square root of the period, four bars here. The result is the HMA.

Slope turns

When the line rises after falling, or falls after rising, on the last closed bars, the build raises a popup naming the direction.

How to work with it

A rising line means upward pace.

A falling line means downward pace.

Turns show up earlier than on an EMA.

The line can overshoot sharp reversals.

`AppliedPrice` `PRICE_CLOSE` feeds it.

Warm-up needs about twenty-four bars.

Alert channels in this build: popup, one message per closed bar.

Slope turns on the last closed bars raise a popup naming the direction. `EnableAlerts` switches it; this build has no other routes.

Every Hull Moving Average Indicator input

Core settings

Setting What it does Default
HmaPeriod Hull MA Period. Length of the average, `20`. 20
AppliedPrice Price fed to the line, `PRICE_CLOSE`. PRICE_CLOSE

Display settings

Setting What it does Default
ShowComponents Show internal WMA helper lines. Show the helper averages, `false`. off

Alert settings

Setting What it does Default
EnableAlerts Popup on slope turns, `true`. on
hull moving average indicator: Inputs panel, period and price source.
Inputs panel, period and price source.

Timeframe and symbol

A 20-bar HMA suits hourly charts. EURUSD H1 is the reference chart, with a turn every day or so. On M15 it tracks session swings. On D1 raise `HmaPeriod` to 50 for a steadier line.

Where the method fails

Speed brings overshoot at sharp turns.

Flat markets make the slope flicker.

A slope turn is not a crossover.

The only notice is a popup.

Copy the compiled Hull Moving Average Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Related on forexmt4systems.com: Moving Average Crossover Strategy.

Download the Hull Moving Average Indicator for MT4 and MT5

The zip holds the compiled Hull Moving Average Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

How does HmaPeriod 20 build the line?

It takes a 10-bar and a 20-bar weighted average, doubles the first and subtracts the second, then smooths the result over four bars. That is Alan Hull’s recipe.

What does ShowComponents add to the chart?

The two helper averages behind the HMA: the doubled half-length line and the full-length line. The build hides them by default because they clutter the chart.

When does the HMA popup fire?

When the line on the last closed bar turns up after falling, or down after rising. One popup fires per bar, naming the new direction.

Why does the HMA overshoot sharp reversals?

Doubling the short average pushes the line ahead of price to cut lag. After a sharp turn it can briefly run past the price before bending back.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Hull Moving Average Indicator as one input. Always backtest before trading live.

Category: this is part of our Trend collection. Also, truly, browse more Trend for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment