This Moving Average is based on RC filter commonly used in electronic. I needed some sort of Moving Average able to cut waves below defined frequencies and with lower intensity. This Moving Average uses one filter based on amplitude (ATR) and one filter based of frequency (all the waves with period smaller than 3.5 times the period of the filter will be cut). The result is a Moving Average that gives some good trend indications. We go long on the blue line and short on the red.
Blue skies!!
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 |
//Filter on amplitude based on ATR and filter //on wave period based on the tau factor. //This filter should disregard all the waves //with a period of less than tau once v=0 once b=1 once input=medianprice if barindex>15 then a=averagetruerange[periodo](close) tau=periodofiltro/3.5 if (abs(MedianPrice-v[1]))<=(a) then input=input[1] b=b[1]+1 else input=MedianPrice-v[1] b=1 endif v=v[1]+(Input*(1-exp(-b/tau))) endif if v>=v[1] then r=0 g=0 b=255 else r=255 g=0 b=0 endif return v coloured (r,g,b), close as "close" |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Hi Gabri,
Thanks for this interesting indicator, I am not a programmer and have a small problem as I work with a black background and it is difficult to see the dark blue line, could you explain how to modify colors in your program please? Thanks a lot.
Kris
Kris, let me know which color you want to use. The lines to change are the 22,23,24.
Hi Gabri. Very interesting indicator. I changed the colours to if v>=v[1] thenr=0g=255b=0elser=255g=0b=0endif
and the lines move! I am puzzled why changing the colours should also move the lines! Any ideas why?
Paulon,
you are right, I used the variable b in too many places 🙂
Try to change the following lines and thanks for the input!!
if v>=v[1] then
r=0
g=0
blu=255
else
r=255
g=0
blu=0
endif
return v coloured (r,g,blu), close as \"close\"
Hi Gabri, have you ever try this in a trading system?
Leo, I used to crosscheck this indicator a long time ago. For the trading I was doing at that time I found it quite useful.
Bonjour Gabri, merci pour l’ensemble de vos publications, serait il possible d’avoir le screener qui indiquerait les changements (couleurs) pour mio-lffma.itf ? je ne connais pas grand chose en programmation, ce que j’ai tenté ne marche pas. Merci, bonne fin de journée