Better HMA Trend Indicator: A Hull Line In Two Colours

Written by Dominic Walsh · Published · Last updated

The better hma trend indicator keeps itself to one job. A Hull average at `HullPeriod` bars, coloured by direction, and nothing else. No arrows, no filters, no panel. The Hull construction is what makes it worth plotting rather than a plain average.

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 2: Hull MA up, Hull MA down
Alerts popup, push notification, email, sound
Inputs 7

Which plots exist

Hull MA up is the lime green line drawn while the average rises.

Hull MA down is the tomato line drawn while it falls.

Only one colour shows at a time, and the change is the whole signal.

Nothing appears anywhere else on the chart.

  • Hull MA up: line, lime green, width 3
  • Hull MA down: line, tomato, width 3
Better HMA trend indicator on EURUSD H1 with the two-colour Hull line
Better HMA trend indicator on EURUSD H1 with the two-colour Hull line

Step by step through the logic

The Hull construction

raw takes twice a weighted average over half the period, minus a weighted average over the whole period. That subtraction cancels most of the lag a single pass carries. The result overshoots slightly, which is the trade.

The final smoothing

The code then weights the raw series across the square root of `HullPeriod` bars. At `20` that final pass covers four bars. Short enough to keep the speed, long enough to stop the line jittering.

Splitting the colour

Both buffers hold the same value. The lime green one takes it while the current reading sits above the previous, and the tomato one takes it otherwise. Colour is therefore a slope reading.

What it is telling you

The line turns sooner than a simple average of the same length.

Colour changes mark where the slope reversed, not where price did.

Overshoot at a turn is normal for a Hull average.

Lengthen `HullPeriod` for a calmer line with fewer colour changes.

Alert channels in this build: popup, push notification, email and sound.

`EnableAlerts` arrives on and `EnablePopup` handles delivery. `EnablePushNotify`, `EnableEmail` and `EnableSound` all begin false. `SoundFile` picks the clip. This build has no once-per-bar guard, so leave the louder channels off unless repeats suit you.

Every Better HMA Trend Indicator input

Core settings

Setting What it does Default
HullPeriod Average length, default `20`. 20

Alert settings

Setting What it does Default
EnableAlerts Master switch for the Hull turn alerts, default `true`. on
EnablePopup Terminal dialog on a Hull turn, default `true`. on
EnablePushNotify Phone push on a Hull turn, default `false`. off
EnableEmail Mail delivery on a Hull turn, default `false`. off
EnableSound Sound playback on a Hull turn, default `false`. off
SoundFile Wav clip for the Hull alert, default `alert.wav`. alert.wav
Better HMA trend indicator inputs: HullPeriod and the alert switches
Better HMA trend indicator inputs: HullPeriod and the alert switches

Settings that fit your chart

A fast average with no filter suits charts where you supply the context. EURUSD H1 is the reference chart, where `HullPeriod` at `20` covers most of a day. On M5 the colour changes several times a session. On H4 a single colour often runs for a week.

When it misleads

Speed costs stability. The line overshoots at turns and can change colour twice around one pivot.

With no arrows and no filter, every judgement about the colour is yours.

A weighted construction still reads past prices only, however quick it looks.

Copy the compiled Better HMA Trend 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.

Background reading on the method behind the Better HMA Trend Indicator: Hull Moving Average Hma at StockCharts ChartSchool, Master of Financial Technical Analysis on Wikipedia.

Download the Better HMA Trend Indicator for MT4 and MT5

The zip holds the compiled Better HMA Trend 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

What makes HullPeriod different from a plain average?

The construction. Two weighted averages get combined so that most of the lag cancels, then a short final pass smooths the result. At `HullPeriod` `20` the line turns several bars before a simple average of the same length.

Why does the Hull MA up line overshoot?

Because the lag cancellation works by subtracting a slower average from twice a faster one. That amplifies recent movement. At a sharp turn the line can push past price briefly before settling back.

Does the Hull MA up plot mark anything?

Only by its colour. The two plots are the whole output, and a change of shade tells you the slope reversed. Everything after that is your call, which is unusual for this library and deliberate here.

How long is the HullPeriod smoothing pass?

The square root of `HullPeriod`, rounded down. At `20` that is four bars. It is short by design, because a longer pass would give back the responsiveness the subtraction just bought.

Are results guaranteed?

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

Category: this is part of our Trend collection. Next, plainly, 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