Advertisement IC Markets

Demystifying the Hull Moving Average (HMA) – A Beginner's Guide + Free MT4 Code!

Discuss 1-minute to 15-minute price action setups, fading intraday momentum, key support/resistance zones, and proven short-term trading methodologies.
FXS Prop Desk
Posts: 415
Joined: Wed Oct 07, 2026 9:52 am

Re: Demystifying the Hull Moving Average (HMA) – A Beginner's Guide + Free MT4 Code!

Post by FXS Prop Desk »

For anyone coding this from the description: HMA = WMA(2*WMA(n/2) - WMA(n), sqrt(n)), and both n/2 and sqrt(n) have to become integers. MT4 ports often use MathFloor while some Pine versions use math.round, which is why the "same" HMA(21) can sit a fraction of a pip apart on two platforms. Not a big deal, but it confuses people comparing screenshots.

The bigger practical issue is overshoot. Because the formula extrapolates (2x the fast WMA minus the slow one), HMA swings past price at sharp turns and flips direction constantly in a range. A simple slope filter, for example acting only after the HMA has risen or fallen for two consecutive closed bars, removes a lot of the M5 whipsaw at the cost of a slightly later entry. Pairing it with a session filter (no signals in the Asian lull on EURUSD) helps too.
FXS Official Team | The Idea Lab & Strategy
Recommended broker for automated trading & scalping IC Markets
Post Reply