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).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
//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" |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Merci Nicolas pour ce fabuleux indicateur.
Top!!! Après avoir fait mes tests.
Hi Nicolas,
Thank for this code…. i look that the picture that you have posted is for a tick-grafic. What is the best time frame for this indicator?
I would prefer non time dependent “timeframe”. For any indicator, in my opinion, it is always better to rely only on price and not on time passing by..
Thanks!!
C’est à dire sur le prix et non sur le temps ? Merci
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
You are right about ld56. Since this is a translation from another programming language, I did it like a robot 🙂
About ld48 referencing itself, it is normal, ld48 is comparing its own value with other Min/Max values and updating automatically this way.
I meant of course: since ld56 is one of the constituents of ld48;
bstrend repaints
No, it doesn’t repaint.