Nicolas

Flat Trend

Category: Indicators By: Nicolas Created: March 26, 2018, 2:17 PM
March 26, 2018, 2:17 PM
Indicators
4 Comments
Flat Trend

This indicator show possible beginning and end of a ‘flat trend’ (ranging market), based on ADX (with DI plus and DI minus) and Parabolic SAR indicator position according to the current price Close.

Converted from MT4 indicator by a request in the indicator’s forum.

//PRC_FlatTrend | indicator
//26.03.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge

PADX=DIplus[14](close)
NADX=DIminus[14](close)
PSAR = SAR[0.02,0.02,0.2]

ExtMapBuffer1=0
ExtMapBuffer2=0
ExtMapBuffer3=0
ExtMapBuffer4=0

if (Psar < Close AND PADX > NADX) then
 ExtMapBuffer2=1
endif
if (Psar < Close AND NADX > PADX) then
 ExtMapBuffer4=1
endif
if (Psar > Close AND NADX > PADX) then
 ExtMapBuffer1=1
endif
if (Psar > Close AND PADX > NADX) then
 ExtMapBuffer3=1
endif

return ExtMapBuffer1 coloured(255,0,0) style(histogram,2), ExtMapBuffer2 coloured(50,205,50) style(histogram,2), ExtMapBuffer3 coloured(250,128,114) style(histogram), ExtMapBuffer4 coloured(144,238,144) style(histogram)

 

Download
Filename: PRC_FlatTrend.itf
Downloads: 492
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

ullle73
8 years ago
#

nicolas, can you somehome make this to be in the background of the price chart?

Nicolas
4 years ago
#

You can ask for a code modification on forums, please open a new topic with your request.

jonpt88
4 years ago
#

none did that yet right?

winnie37
9 years ago
#

Merci Nicolas. J'ai un bug d'affichage quand j'utilise ton indicateur. La bougie en cours ne s'affiche pas...Ni la barre ne cours de Flat trend...Elle ne s'adffiche qu'en switchant sur un autre graphe et en y revenant. Peux-tu vérifier? Merci

ProRealCode ProRealCode
Loading...