Flat Trend

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

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: 484
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...