Page 2 of 2

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

Posted: Thu Oct 15, 2026 2:07 pm
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.