indicator · on price · open source

Hull Moving Average

Deepwick · @deepwickv1Updated 2 Oct 2026▲ 0 users
Running…
Loading chart…

About

Hull Moving Average combines two WMAs of half and full length, then smooths the difference through a third WMA of sqrt(N). The result is very smooth with dramatically lower lag than an SMA at the same length.

  • Excellent swing-line on crypto and indices where lag kills the entry.
  • Default 20 looks like an SMA 14 but turns ~3 bars sooner.
  • Pair with a slower MA for a non-trendline HMA crossover.

Source code

//@version=5
indicator("Hull Moving Average", overlay=true)
len = input.int(20, "Length", minval=2, maxval=500)
src = input.source("close", "Source")
hma = ta.wma(2 * ta.wma(src, len / 2) - ta.wma(src, len), math.round(math.sqrt(len)))
p_HMA = plot(hma, "HMA", color=color.purple, linewidth=2)
alertcondition(ta.crossover(close, hma), "Price crosses above HMA", "Price crossed above the HMA")
alertcondition(ta.crossunder(close, hma), "Price crosses below HMA", "Price crossed below the HMA")

Comments

No comments yet.

Sign in to comment.