The BSTrend indicator shows you the prevailing currency trend. Blue bars indicate uptrend (1). Violet bars indicate downtrend (-1).
Trading Signals:
(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"
You must be logged in to post a comment.
Hi Nicolas, ld48 = 0.66 * ((ld16 - ld96) / (ld104 - ld96) - 0.5) + 0.67 * ld56 ld48 = Min(Max(ld48, -0.999), 0.999) you assign two different expressions to the same parameter (ld48)... ld56 = ld48: this seems to me a circular code since ld48 is one of the constituents of ld56; ld80 = gda80: something similar goes for this assignment; The solution maybe is to give your parameters real names. That forces you to make clear what they refer to and it gives me an opportunity to elaborate on it. Best regards, Jerke van der Geest
C’est à dire sur le prix et non sur le temps ? Merci
Merci Nicolas pour ce fabuleux indicateur. Top!!! Après avoir fait mes tests.
bstrend repaints