Pine Script (TradingView)
Ceci est un exemple Pine Script TradingView pour cet indicateur. Collez-le dans l'editeur Pine TradingView, ajoutez-le au graphique, puis ajustez les parametres selon votre marche et votre unite de temps.
//@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)