What Is a Worked Example of HMA? (Assumptions, Mechanics, and How to Verify)

Explore What is a worked: mechanics, differences, limitations, and practical checks.

Direct answer

A worked example of HMA (Hull Moving Average) shows the calculation step by step for a specific set of prices, with explicit assumptions about the period and how you align bars. Below is one numerical scenario that you can reproduce on paper.

Because HMA is a moving average, it depends on recent data and on the exact calculation convention (period rounding, weighting method, and indexing). So the goal of a worked example is not prediction, but verification of the mechanics.

Mechanism and definition

HMA is designed to smooth a time series while attempting to reduce lag. A common high-level construction is:

  1. Compute a weighted moving average (WMA) of the prices over a “half” period.
  2. Compute a WMA of the prices over the full period.
  3. Combine them using the difference, then compute another WMA over the result, using a “square root” period.

Key terms:

  • Price series: a sequence of values over time (for example, closing prices).
  • Weighted moving average (WMA): an average where newer observations can receive higher weights; you must use one consistent WMA definition.
  • Periods: the window lengths used in each WMA stage.
  • Lag: how much the average tends to trail changes in the underlying series.

Assumption for this worked example (explicit):

  • We use a WMA where, for a window of length n, the oldest value has weight 1 and the newest value has weight n.
  • We handle the “half period” as floor(P/2).
  • We handle the “square-root period” as floor(sqrt(P)).
  • We compute an HMA value at the end of each stage window (standard right-aligned convention).

Worked numerical example (step by step)

Assumed period: P = 9.

  • Half period: floor(9/2) = 4
  • Square-root period: floor(sqrt(9)) = 3

Assumed price sequence: We use 9 consecutive “prices” to produce one HMA output aligned to the last price.

  • Prices (oldest → newest):
    • p1=100, p2=102, p3=101, p4=103, p5=105, p6=104, p7=106, p8=107, p9=108

Step A: WMA over half period (n=4)

Compute WMA on the last 4 prices: p6..p9 = [104, 106, 107, 108]. Weights for n=4: [1,2,3,4]. Sum of weights = 10.

  • Weighted sum = 1·104 + 2·106 + 3·107 + 4·108
  • = 104 + 212 + 321 + 432 = 1069
  • WMA_half = 1069 / 10 = 106.9

Step B: WMA over full period (n=9)

Compute WMA on all 9 prices: p1..p9. Weights for n=9: [1..9]. Sum = 45.

  • Weighted sum = 1·100 + 2·102 + 3·101 + 4·103 + 5·105 + 6·104 + 7·106 + 8·107 + 9·108
  • = 100 + 204 + 303 + 412 + 525 + 624 + 742 + 856 + 972
  • = 4737
  • WMA_full = 4737 / 45 = 105.266666… (about 105.27)

Step C: Create the difference series (alignment note)

A full HMA implementation typically constructs an intermediate series using aligned WMA values, then applies another WMA.

Assumption for simplification (explicit): For this single output, we align the “difference” at the newest point using:

  • diff = (2 · WMA_half) − WMA_full So:
  • diff = 2·106.9 − 105.266666…
  • = 213.8 − 105.266666… = 108.533333…

Step D: Final WMA of the intermediate series (n=3)

To compute the final WMA, you need three diff values (at three consecutive points), not just one. Since the worked example must be fully reproducible, we must compute the needed intermediate diffs as well.

So we extend the calculation conceptually to the last 3 output positions, using the same 9-price window for each intermediate stage would not be enough. Instead, we state an expanded assumption:

Assumption: We have 11 prices to compute one final HMA point when P=9 under the chosen staged convention.

Extended price sequence (oldest → newest), now length 11:

  • p1=99, p2=100, p3=102, p4=101, p5=103, p6=105, p7=104, p8=106, p9=107, p10=108, p11=109

Now we outline the three needed diff values at the last three “newest points” of the 3-length final WMA. Under the same alignment rules:

  • diff(t) uses WMA_half(t) from the last 4 prices up to t, and WMA_full(t) from the last 9 prices up to t.

Compute for t = 9, 10, 11:

  • For t=9: use prices p6. . p9 for WMA_half, and p1. . p9 for WMA_full. - For t=10: use prices p7. .
Trading foreign exchange and CFDs involves substantial risk. Information on FoxiForex is educational and is not personal financial advice. Sponsored placements are labelled clearly.