p1 = average[t1](close)
p2 = average[t1*2](close)
p3 = average[t1*4](close)
p4 = average[t1*8](close)
a1 = p1 > p2 and p2 > p3 and p3 > p4
a2 = p1 < p2 and p2 < p3 and p3 < p4
if a1 then
b=1
elsif not a1 and not a2 then
b=0
elsif a2 then
b=-1
endif
return b
Made this today and found some good use for it. Do with it as u may 🙂
t1 = 2 as default
(giving u averages = 2, 4, 8, 16)
Thank you … I added it to here
Snippet Link Library
Hey thanks again Jebus, I’ve already worked your filter into 2 of my Systems that were marginal and it has improved the stats overall.
Lowered the final profit on one System, but better Gain to Loss and Av Gain to Av Loss etc.
I’ll run the originals alongside and see if the good stuff works out in Forward Test
Cheers
Here is a similar version that I wrote a while back for progression of powers averages. In this version you can choose an average type and customclose to base the average on as well as a maximum average period to calculate up to. If converted to a strategy filter this gives us plenty of variables to test.
type = 1
maxaverage = 32
j = 1
while j < maxaverage
j = j * 2
ave1 = average[j,type](customclose)
ave2 = average[j*2,type](customclose)
if ave1 > ave2 then
upflag = 1
else
upflag = 0
break
endif
wend
j = 1
while j < maxaverage
j = j * 2
ave1 = average[j,type](customclose)
ave2 = average[j*2,type](customclose)
if ave1 < ave2 then
downflag = -1
else
downflag = 0
break
endif
wend
return upflag coloured(0,128,0) style(histogram,2), downflag coloured(128,0,0) style(histogram,2)
Glad u found usage of the indicator grahal.
Will check out ur ma filter Vonasi 🙂
Will check out ur ma filter Vonasi
I just noticed that my return of +1 or -1 is the opposite way round to yours.
Vonasi I added yours to here
Snippet Link Library