very simple MA filter
Forums › ProRealTime English forum › ProBuilder support › very simple MA filter
- This topic has 6 replies, 3 voices, and was last updated 5 years ago by GraHal.
-
-
04/28/2019 at 3:39 PM #973021234567891011121314151617p1 = 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 > p4a2 = p1 < p2 and p2 < p3 and p3 < p4if a1 thenb=1elsif not a1 and not a2 thenb=0elsif a2 thenb=-1endifreturn 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)
04/28/2019 at 3:49 PM #9730304/28/2019 at 10:50 PM #97311Hey 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
04/29/2019 at 7:19 AM #97319Here 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.
123456789101112131415161718192021222324252627282930type = 1maxaverage = 32j = 1while j < maxaveragej = j * 2ave1 = average[j,type](customclose)ave2 = average[j*2,type](customclose)if ave1 > ave2 thenupflag = 1elseupflag = 0breakendifwendj = 1while j < maxaveragej = j * 2ave1 = average[j,type](customclose)ave2 = average[j*2,type](customclose)if ave1 < ave2 thendownflag = -1elsedownflag = 0breakendifwendreturn upflag coloured(0,128,0) style(histogram,2), downflag coloured(128,0,0) style(histogram,2)04/29/2019 at 7:43 AM #9732004/29/2019 at 8:01 AM #97324Will check out ur ma filter Vonasi
I just noticed that my return of +1 or -1 is the opposite way round to yours.
04/29/2019 at 10:01 AM #97328Vonasi I added yours to here
-
AuthorPosts
Find exclusive trading pro-tools on