Nicolas

Trend Impulse Filter

Category: Indicators By: Nicolas Created: April 6, 2020, 11:21 AM
April 6, 2020, 11:21 AM
Indicators
9 Comments
Trend Impulse Filter

There is a lot of indicators similar to this one, however i think this one don’t share the same calculation method and this is why i share it. This indicator aim to forecast price direction using an exponential filter architecture using highest and lowest information for the estimation of a smoothing variable. This filter is similar to the average Max-Min filter.

In the code a is equal to 1 when the price is greater or lower than any past price over length period, else a is equal to 0. The center parameter control the filtering degree of the output, when center is equal to 1 and a = 1 the indicator return the highest or lowest depending on market current trend, when center is superior to 1 the output will be smoother, however the reactivity of the indicator will still depend on the length parameter.

A color option show you the trend of the market, however the generated signals are the same that can be generated from a Donchian channel.

When highest is greater than previous highest the indicator direction will move upward, else if lowest is lower than previous lowest the indicator direction will move downward. Therefore the indicator can give information on the Donchian channels direction and provide a nice filter.

(description above is from the original author alexgrover, all credits go to him).

//PRC_Trend Impulse Filter | indicator
//06.04.2020
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from Pinescript code (author:alexgrover)

// --- settings 
length = 100
center = 1
arrows = 1 // Plot Arrows 0=false ; 1=true
// --- end of settings 

once b = src
if barindex>length then 
 src = (highest[length](high)+lowest[length](low))/2
 rising = src-src[length]>0
 falling = src-src[length]<0
 a = rising or falling
 b = exponentialaverage[center](a*src+(1-a)*b[1])
 //—-

 if b>b[1] then
  os=1
  cr=0
  cg=128
  cb=255
 elsif b<b[1] then 
  os=-1
  cr=230
  cg=81
  cb=0
 endif

 if os <> os[1] and arrows then 
  if os>0 then 
   drawarrowup(barindex,b[1]) coloured(cr,cg,cb)
  else
   drawarrowdown(barindex,b[1]) coloured(cr,cg,cb)
  endif
 endif
endif

return b coloured(cr,cg,cb) style(line,3) as "Trend Impulse Filter"

 

Download
Filename: PRC_Trend-Impulse-Filter.itf
Downloads: 785
Nicolas
Nicolas Legend
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

ipbvba
5 years ago
#

Est il possible de le transformer en indicateur (pour ne plus avoir les lignes mais uniquement fleches)? merci

ribes65
6 years ago
#

Bonjour Nicolas, Merci pour votre travail. Est-il envisageable de créer un screener pour détecter les signaux d'achat?

Nicolas
6 years ago
#

Bien sûr, merci de formuler une demande dans le forum des screeners pour prorealtime. En respectant les règles de publication, merci.

tonycom95
6 years ago
#

Bonjour Nicolas est ce que cet outil est utilisable sur les actions ? Désolé si ma question est stupide mais je débute en bourse

Nicolas
6 years ago
#

Bien sûr, pourquoi pas ?

jacob78692110
6 years ago
#

Bonjour, quand je colle le code, l'indicateur n'est pas sur les prix mais il est la où se trouve l'emplacement rsi, stochastique, etc.... je comprend pas tous les code je colle ce trouve en bas

Nicolas
6 years ago
#

Il faut l'appliquer sur le prix, en allant dans les paramètres du prix.

raulmerino1988
6 years ago
#

Bonjour Nicolas, je voudrais vous poser une question technique sur les alarmes, mais je ne peux pas vous contacter.

Nicolas
6 years ago
#

Les questions non liées à ce post doivent être posées sur les forums.

ProRealCode ProRealCode
Loading...