gabri

Low Frequency Filter Moving Average (LFFMA)

Category: Indicators By: gabri Created: April 12, 2017, 12:48 PM
April 12, 2017, 12:48 PM
Indicators
7 Comments
Low Frequency Filter Moving Average (LFFMA)

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!!

//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"

Download
Filename: Mio-LFFMA.itf
Downloads: 249
gabri
gabri Master
This author is like an anonymous function, present but not directly identifiable. More details on this code architect as soon as they exit 'incognito' mode.
Author’s Profile

Comments

Nolubok
6 years ago
#

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

gabri
9 years ago
#

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.

Leo
Leo
9 years ago
#

Hi Gabri, have you ever try this in a trading system?

gabri
9 years ago
#

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"

 

paulon
9 years ago
#

Hi Gabri.  Very interesting indicator.  I changed the colours to if v>=v[1] then
r=0
g=255
b=0
else
r=255
g=0
b=0
endif

and the lines move! I am puzzled why changing the colours should also move the lines!   Any ideas why?

gabri
9 years ago
#

Kris, let me know which color you want to use. The lines to change are the 22,23,24.

Kris V
9 years ago
#

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

ProRealCode ProRealCode
Loading...