Moving Average Trend Filter

Category: Indicators By: Nicolas Created: October 19, 2015, 7:51 PM
October 19, 2015, 7:51 PM
Indicators
1 Comment

Very simple representation of a trend, this one cumulate the candlesticks closes above and under a defined period of a simple moving average. Simple but yet effective to avoid classical whipsaw, i believe this indicator could help any trend followers in trading decision. Any comments are welcome ! 

// Parameters :
// N = 30

i1 = average[N](close)

IF (close>i1) THEN
   a = a + 1
ELSE
   a = a - 1
ENDIF

i2 = average[N](a)

RETURN a as "cumulated close over/under MA", i2 coloured(238,230,133) as "trend filter"

 

Download
Filename: Moving-Average-Trend-Filter.itf
Downloads: 234
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...