Coral Trend Indicator / THV Coral

Category: Indicators By: Nicolas Created: February 12, 2016, 2:15 PM
February 12, 2016, 2:15 PM
Indicators
0 Comments

Here is an indicator somehow popular in forex trading, known as “THV Coral”. The code here is adapted from Pinescript version.

It is a PSAR-like indicator that plot green and red points to indicate trend direction and/or trend filter.

 

// parameters
// sm = 21
// cd = 0.4

if(barindex>sm) then

 dii = (sm - 1.0) / 2.0 + 1.0
 c1 = 2 / (dii + 1.0)
 c2 = 1 - c1
 c3 = 3.0 * (cd * cd + cd * cd * cd)
 c4 = -3.0 * (2.0 * cd * cd + cd + cd * cd * cd)
 c5 = 3.0 * cd + 1.0 + cd * cd * cd + 3.0 * cd * cd

 src = Close
 i1=0
 i2=0
 i3=0
 i4=0
 i5=0
 i6=0

 i1 = c1*src + c2*i1[1]
 i2 = c1*i1 + c2*i2[1]
 i3 = c1*i2 + c2*i3[1]
 i4 = c1*i3 + c2*i4[1]
 i5 = c1*i4 + c2*i5[1]
 i6 = c1*i5 + c2*i6[1]

 bfr = -cd*cd*cd*i6 + c3*(i5) + c4*(i4) + c5*(i3)

endif

if bfr>bfr[1] then
  col = 1
else
  col = -1
endif

RETURN bfr coloured by col as "Coral Trend Indicator"

 

Download
Filename: Coral-Trend-Indicator.itf
Downloads: 227
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...