I have adapted my VAMA (Volatility Adaptive Moving Average) to include the Hull type of average following a request by JMat45 on the library post of the VAMA indicator that can be found here:
VAMA – Volatility Adaptive Moving Average
ITF file:
[attachment file=”110347″]
Hull moving average is average type 7.
//VAMA - Volatility Adaptive Moving Average v2
//(Now includes Hull moving average type)
//By Vonasi
//20191016
defparam calculateonlastbars = 1000
//percentage = 15 // percentage price move to calculate p on.
//type = 1 //average type
type = max(0,min(type,7))
if barindex >= 1 then
hh = close
ll = close
p = 0
for a = 0 to barindex
hh = max(hh,high[a])
ll = min(ll,low[a])
if (hh - ll)/close >= (percentage/100) then
p = a+1
break
endif
next
if p > 0 then
if type = 7 then
inner = 2*weightedaverage[round(p/2)](customclose)-weightedaverage[p](customclose)
vama = weightedaverage[round(sqrt(p))](inner)
else
vama = average[p,type](customclose)
endif
endif
endif
if pDisplayed then
if p <> p[1] then
drawtext("#p#", barindex, vama ,SansSerif,Bold,10) COLOURED(0,0,0)
endif
endif
return vama