Loading…

Hull Moving Average

A weighted moving average already leans on recent bars more than an SMA, but it still lags the same way any moving average does. Hull's construction computes a WMA over the full period and a second WMA over half the period, takes twice the fast one minus the slow one, and runs that difference series back through a third WMA sized to the square root of the original period. The middle step is not cosmetic - it is what removes the lag - and the final smoothing pass is what keeps the result from being jagged. This is implemented as the literal three-stage formula, not an approximation: two calls to the platform's own iMA() in MODE_LWMA build the raw difference series, and a manually weighted sum over that series performs the final stage, because the final WMA is applied to a derived series that iMA() itself cannot see. Notes and limitations - Needs InpPeriod + round(sqrt(InpPeriod)) bars of history before the first value appears; earlier bars are intentionally left empty rather than guessed. - Less lag does not mean no lag or no false turns - the Hull line can still wobble in a choppy range like any short-period average. - Recalculated per bar from price directly, with no dependency on its own previous value, so there is nothing here that can repaint or drift.

Indicator · MT5 · v1.0 · Free

About Hull Moving Average

Hull Moving Average is an indicator for MetaTrader 5 based on Moving Average. It has 2 settings, such as Period and Applied price. MQL source code included.

Files in the download: HullMa.ex5, HullMa.mq5, HullMa.txt.

Settings

SettingDefaultWhat it does
Period20Hull period
Applied pricePRICE_CLOSEApplied price

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Moving Average · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria