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:
https://www.prorealcode.com/prorealtime-indicators/vama-volatility-adaptive-moving-average/
ITF file:
VAMA-v2
Hull moving average is average type 7.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//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
2 users thanked author for this post.