BSTrend

Category: Indicators By: Nicolas Created: November 5, 2018, 9:18 AM
November 5, 2018, 9:18 AM
Indicators
10 Comments

The BSTrend indicator shows you the prevailing currency trend. Blue bars indicate uptrend (1). Violet bars indicate downtrend (-1).

Trading Signals:

  • BUY: Wait for the first blue bar.
  • SELL: Wait for the first violet bar.

(converted from MT4 version by request in the English forum).

//PRC_BStrend | indicator
//05.11.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from MT4 indicator

// --- settings 
period=12
// --- end of settings 

if barindex>period then 
 ld104 = highest[period](high)
 ld96 = lowest[period](low)
 ld16 = (High[0] + Low[0]) / 2.0
 ld48 = 0.66 * ((ld16 - ld96) / (ld104 - ld96) - 0.5) + 0.67 * ld56
 ld48 = Min(Max(ld48, -0.999), 0.999)
 gda80 = Log((ld48 + 1.0) / (1 - ld48)) / 2.0 + ld80 / 2.0
 ld56 = ld48
 ld80 = gda80

 li124 = 1
 ld8 = gda80[0]
 ld0 = gda80[1]
 if ((ld8 < 0.0 and ld0 > 0.0) or ld8 < 0.0) then 
  li124 = 0//FALSE;
 endif
 if ((ld8 > 0.0 and ld0 < 0.0) or ld8 > 0.0) then 
  li124 = 1//TRUE;
 endif
 if (li124=0) then
  gs92 = -1 //"Downtrend"
  r=238
  g=130
  b=238
 else 
  gs92 = 1 //"Uptrend"
  r=0
  g=191
  b=255  
 endif
endif

return gs92 coloured(r,g,b) as "BS Trend"

 

Download
Filename: PRC_BStrend.itf
Downloads: 409
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...