ForexBestRobots.comCompare EAs →
EN

HULL MA · WMA WEIGHTS · REAL FOREX CHARTS

Hull Moving Average in Forex: WMA Weights, Rounding and Real Charts

Trace the weighted averages, compare two rounding rules on identical candles and distinguish an HMA turn from a price cross.

Real USD/JPY H1 · 2024-01-04 14:00 UTC. N=21, h=10, r=4. The two price WMAs, RAW and HMA use the identical retained candles.
Real USD/JPY H1 · 2024-01-04 14:00 UTC. N=21, h=10, r=4. The two price WMAs, RAW and HMA use the identical retained candles.

The Hull Moving Average combines a short and a full-period weighted average, then smooths their difference with another WMA. The result depends on the weighting direction and the integer lengths used. This guide checks those choices on real Forex quotes without treating a responsive line as a tested trading strategy.

1. Follow the three weighted averages

Alan Hull developed HMA in 2005. A WMA over h recent closes reacts differently from a WMA over N closes. Doubling the short average and subtracting the full one produces the intermediate line RAW. A final WMA over r RAW values produces HMA. All four quantities are in price units, but RAW is not the finished HMA.

The subtraction compensates for part of the delay introduced by averaging. It also creates signed effective weights, so HMA can overshoot its input prices. Neither zero lag nor smoothness on every market path is guaranteed. The three averages share the same quotes; they are not three independent confirmations.

2. Calculate the weights and the intermediate line

C[t] is a completed H1 close. WMA(m) uses the latest m retained observations, with weights 1 through m from oldest to newest and denominator m(m+1)/2. Reversing that order produces a different indicator. The main calculation uses h=⌊N/2⌋ and r=⌊√N⌋ for N≥2, with no horizontal shift.

First calculate WMA(h) and WMA(N) at the same candle. Form RAW=2×WMA(h)−WMA(N), then apply WMA(r) to the latest r available RAW values. Do not apply the last WMA directly to price or substitute an EMA at any stage. The numerical table exposes all intermediate values.

WMAₘ(x)[t] = Σⱼ₌₀ᵐ⁻¹ (m−j) × x[t−j] / (m(m+1)/2)
h = ⌊N/2⌋     r = ⌊√N⌋
RAW[t] = 2 × WMAₕ(C)[t] − WMAₙ(C)[t]
HMA[t] = WMAᵣ(RAW)[t]

3. Read HMA on real Forex candles

The first example shows the candles, both price WMAs, RAW and HMA21. Under the integer-part rule, h=10 and r=4. The selected close satisfies Close>HMA21>WMA(21), with at least one pip between HMA and the full WMA. One pip here is 0.01 JPY per USD.

The picture describes how these filters respond to the same price history. A line lying closer to the latest price does not establish a better entry. A separate trading test would need execution, risk, exit and transaction-cost rules.

From two price WMAs through RAW to HMA

Real USD/JPY H1 · 2024-01-04 14:00 UTC. N=21, h=10, r=4. The two price WMAs, RAW and HMA use the identical retained candles.
Real USD/JPY H1 · 2024-01-04 14:00 UTC. N=21, h=10, r=4. The two price WMAs, RAW and HMA use the identical retained candles.

Interval end · UTC: 2024-01-04T14:00:00Z · Close: 144.520

Rounding rulehrWMA(h)WMA(N)RAWHMA21
Integer parts104144.047455143.752857144.342052144.177877
Nearest integer · halves up115144.011515143.752857144.270173144.066782

4. Compare the rounding rules

Hull’s published formula uses Integer() notation. This guide explicitly interprets it as taking the integer part of each positive length. StockCharts documents a nearest-integer convention; our comparison rounds exact halves upward. For N=21 the lengths are h=10,r=4 versus h=11,r=5. For N=55 they are 27,7 versus 28,7. For N=20 both give 10,4.

The second example holds N=21, price input and selected candle fixed. Only the rounding rule changes. The final lines differ by at least five pips in this example; that threshold selected an illustration, not a profitable trade. Changing the short or final window can also change a line’s slope and its first available timestamp.

Same candles and period, different rounding

Real USD/JPY H1 · 2024-01-10 16:00 UTC. HMA21 with integer parts versus nearest rounding. The price history and candle are held fixed.
Real USD/JPY H1 · 2024-01-10 16:00 UTC. HMA21 with integer parts versus nearest rounding. The price history and candle are held fixed.

Interval end · UTC: 2024-01-10T16:00:00Z · Close: 145.600

Rounding rulehrWMA(h)WMA(N)RAWHMA21
Integer parts104145.236545145.031645145.441446145.327026
Nearest integer · halves up115145.213939145.031645145.396234145.261778

5. Separate a line turn from a price cross

Let ΔHMA[t]=HMA[t]−HMA[t−1]. A fresh upward turn means ΔHMA[t]>0 and ΔHMA[t−1]≤0; a downward turn uses ΔHMA[t]<0 and ΔHMA[t−1]≥0. These labels require three complete, adjacent hours and three available HMA values. Simply continuing to rise is not another upward turn.

The third example has an upward HMA21 turn while the closing price is still below HMA. A fresh upward price cross instead requires C[t−1]≤HMA[t−1] and C[t]>HMA[t], using two complete adjacent hours. A positive slope, a turn and a price cross must therefore be read separately. None is an automatic order.

An upward HMA turn with price still below

Real USD/JPY H1 · 2024-05-08 21:00 UTC. HMA21 turns upward while Close<HMA. The 64-hour window ends at this candle; no trade result is simulated.
Real USD/JPY H1 · 2024-05-08 21:00 UTC. HMA21 turns upward while Close<HMA. The 64-hour window ends at this candle; no trade result is simulated.

Interval end · UTC: 2024-05-08T21:00:00Z · Close: 155.620

Rounding rulehrWMA(h)WMA(N)RAWHMA21
Integer parts104155.555818155.457922155.653714155.646390
Nearest integer · halves up115155.550000155.457922155.642078155.632222

6. Check availability and the actual input window

The full WMA first exists on recorded bar N. The final stage needs r RAW observations, so the first HMA is on bar N+r−1. For N=21 this is bar 24 with integer parts and bar 25 with nearest rounding. HMA20 begins on bar 23 and HMA55 on bar 61 under both rules. Before HMA exists, one or both price WMAs and RAW may already be available. Missing results are not zeros.

Unlike the recursive EMA stages in DEMA and TEMA, this HMA uses a finite input window. Earlier prices outside that complete window do not affect the mathematical result. Every retained close, including a partial hour, counts once; gaps are not filled or reset. Recorded H1 bars need not be consecutive clock hours. When comparing an MT4 or another platform’s HMA, check price input, weights, rounding, available bars and shift.

7. Explore the candles and calculation

Choose period 20, 21 or 55, a rounding rule and the visible lines. These are fixed illustrations, not profit-optimized settings. The chart ends at the selected candle and the table compares periods at that same timestamp. Example buttons restore N=21, integer parts and the comparison view. The first-value button deliberately visits early history.

All three main examples require a complete, consecutive 64-hour display window. Selection is chronological: the first eligible Close>HMA>WMA(N) configuration with at least a one-pip gap; the first eligible rounding difference of at least five pips starting 64 recorded bars after the first example; and the first upward turn with Close<HMA. No trades are ranked by their later outcome.

Loading historical candles…

Interval end · UTC
—
OHLC · JPY per USD
—
Close
—
Short WMA length · h
—
Final WMA length · r
—
Required retained bars
—
WMA(h)
—
WMA(N)
—
RAW = 2 × WMA(h) − WMA(N)
—
HMA
—
Integer HMA minus nearest HMA · pip
—
HMA change · pip
—
Observed minute bars
—
Hour completeness
—
Gap before this hour
—
Recorded bars from history start
—
Gaps inside the input window
—
Partial hours in the input window
—
Fresh price cross
—
Fresh HMA turn
—

Same candle · periods 20 / 21 / 55

Period · recorded barshrWMA(h)WMA(N)RAWHMAClose − HMA · pip

Frequently asked questions

Is HMA the same as a normal WMA?

No. It combines two price WMAs into RAW, then smooths RAW with a third WMA. A single WMA(N) is a different calculation.

Why can two HMA lines differ at the same period?

Check the half and square-root rounding, weight direction, price source, available input window, gaps and horizontal shift. The same name and N are not enough.

When does the first HMA become available?

With complete retained windows it is on recorded bar N+r−1. HMA21 starts on bar 24 under integer parts and bar 25 under the nearest convention used here.

Does an upward HMA turn mean price has crossed above it?

No. The real example shows an upward turn with the close still below HMA. Slope and price position are separate observations.

Does HMA eliminate delay or guarantee profitable signals?

No. It can overshoot, change direction and be crossed repeatedly. Profitability requires separate testing of a fully specified strategy with costs.

Are the candles real, and is this a backtest?

The guide reuses retained historical Forexite USD/JPY quotes. It verifies indicator calculations; it does not simulate orders, fills or trading returns.

Data, calculation choices and scope

The guide reuses the verified 375,702 USD/JPY minute observations from Forexite’s 2024 Trade/MetaStock archives used for DEMA and TEMA. Fixed GMT+1 labels are shifted back one hour to UTC. Minute labels are treated as interval ends, with H1 buckets (start,end]. These are declared reconstruction assumptions.

The 6,265 retained H1 intervals end from 2024-01-01 23:00 UTC through 2024-12-31 23:00 UTC: 6,178 complete hours, 87 partial hours and 52 gaps before recorded hours. Lines break at gaps. Cross and turn labels have their own adjacent-hour checks; the panel also reports gaps and partial hours within the selected HMA input window. Quotes do not supply a complete bid/ask execution path or guarantee agreement with a broker’s candles.

The CSV contains hourly candles and both rounding conventions for all three periods. The method ZIP includes retained minute inputs, the original archive URL/checksum list, calculation code and verification results. Hourly reconstruction and WMA calculations are independently checked; the original 366 daily ZIPs were not downloaded and parsed again for this release.

Primary references