Reversal signal ThreeLineBreak

Category: Indicators By: Nicolas Created: June 23, 2017, 10:12 AM
June 23, 2017, 10:12 AM
Indicators
27 Comments

This is a modified version of the three line break price representation. It is composed with 2 lines made of Close price values forming a “cloud”.

  • If the trend is bullish and the price breach the lower level of the green cloud, a new bearish trend is taking place.
  • If the current trend is bearish and the price breakout the upper band of the cloud, a new bullish trend is forming.

This is a “price action” indicator, signals may be filtered by long term trend analysis with other indicators such as Supertrend for instance.

This indicator has been converted from Nanotrader coding language by a request in the French forum.

 

//PRC_RevertSignal Three Line Break | indicator
//22.06.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//translated from Nanotrader

if barindex=1 then //barindex
 if (close >= open) then
  xtrend = 1
  trend = xtrend
  xu = close
  xu1 = open
  xu2 = open
  xu3 = open
  CL = xu
  OP = xu1
  LL = OP
  HH = CL
 else
  xtrend = -1
  trend = xtrend
  xu = close
  xu1 = open
  xu2 = open
  xu3 = open
  CL = xu
  OP = xu1
  LL = CL
  HH = OP
 endif
else //barindex continue
 if (xtrend = 1) then
  if (close > xu) then
   trend = xtrend
   xu3 = xu2
   xu2 = xu1
   xu1 = xu
   xu = close
   CL = xu
   OP = xu1
   LL = OP
   HH = CL
  elsif (close < xu3) then
   xtrend = -1
   trend = xtrend
   xu = close
   xu2 = xu1
   xu3 = xu1
   CL = xu
   OP = xu1
   LL = CL
   HH = OP
  else
   trend = xtrend
   CL = CL[1]
   OP = OP[1]
   LL = LL[1]
   HH = HH[1]
  endif
 else //xtrend <>1
  if (close > xu3) then
   xtrend = 1
   trend = xtrend
   xu = close
   xu2 = xu1
   xu3 = xu1
   CL = xu
   OP = xu1
   LL = OP
   HH = CL
  elsif (close < xu) then
   trend = xtrend
   xu3 = xu2
   xu2 = xu1
   xu1 = xu
   xu = close
   CL = xu
   OP = xu1
   LL = CL
   HH = OP
  else
   trend = xtrend
   CL = CL[1]
   OP = OP[1]
   LL = LL[1]
   HH = HH[1]
  endif
 endif
endif

if trend>0 then
 r=0
 g=200
 b=0
else
 r=200
 g=0
 b=0
endif

if trend<>trend[1] then
 BACKGROUNDCOLOR(200,200,200)
endif

RETURN CL coloured (r,g,b), xu3 coloured (r,g,b)

 

Download
Filename: PRC_RevertSignalThreeLineBreak.itf
Downloads: 897
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...