Pine Script (TradingView)
Este e um exemplo de Pine Script do TradingView para este indicador. Cole no Pine Editor do TradingView, adicione ao grafico e ajuste os parametros para seu mercado e timeframe.
//@version=6
indicator("Hull Moving Average (HMA)", overlay=true)
length = input.int(21, "HMA Length")
hma = ta.wma(2 * ta.wma(close, length / 2) - ta.wma(close, length), math.round(math.sqrt(length)))
rising = hma > hma[1]
longSignal = ta.crossover(close, hma)
shortSignal = ta.crossunder(close, hma)
plotshape(longSignal, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(shortSignal, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
plot(hma, "HMA", color=rising ? color.green : color.red, linewidth=2)