A trend following indicator published in IFTA Journal by Bharat Jhunjhunwala. It is mainly to be traded on big timeframes.
The B-Xtrender elucidates the dilemma of differentiating a trend change from a minor correction, thus providing specific entry, scaling and exit signals. It is an indicator created to give a single glance of the ongoing trend. Even a casual look at the system can acquaint the viewer about the long-term and shortterm trend.
Two indicators used in conjunction constitute the B-Xtrender.
The first indicator determines the short-term trend while the second indicator determines the long-term trend. Once the clarity over market movement is established, a myriad of entry techniques can be used to trade, with the help of the B-Xtrender.
For anyone looking into the indicators please have in the source below where logic behing the indicator is nicely explained.
ifta.org/public/file…_ifta_journal_19.pdf
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
//PRC_B-Xtrender | indicator //03.08.23 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge // --- settings shortl1 = 5 //Short - L1 shortl2 = 20 //Short - L2 shortl3 = 15 //Short - L3 longl1 = 20 //Long - L1 longl2 = 15 //Long - L2 // --- end of settings shortTermXtrender = rsi[shortl3](average[shortl1,1]-average[shortl2,1])-50 longTermXtrender = rsi[longl2](average[longl1,1])-50 if shortTermXtrender > 0 then if shortTermXtrender > shortTermXtrender[1] then r=0 g=255 else r=0 g=100 endif else if shortTermXtrender > shortTermXtrender[1] then r=255 g=0 else r=100 g=0 endif endif xe11 = average[5,1](shortTermXtrender) xe21 = average[5,1](xe11) xe31 = average[5,1](xe21) xe41 = average[5,1](xe31) xe51 = average[5,1](xe41) xe61 = average[5,1](xe51) b1 = 0.7 c11 = -b1*b1*b1 c21 = 3*b1*b1+3*b1*b1*b1 c31 = -6*b1*b1-3*b1-3*b1*b1*b1 c41 = 1+3*b1+b1*b1*b1+3*b1*b1 maShortTermXtrender = c11 * xe61 + c21 * xe51 + c31 * xe41 + c41 * xe31 if maShortTermXtrender > maShortTermXtrender[1] then rr=0 gg=255 else rr=255 gg=0 endif if maShortTermXtrender > maShortTermXtrender[1] and maShortTermXtrender[1] < maShortTermXtrender[2] then drawtext("●",barindex,maShortTermXtrender,dialog,bold,14) coloured("lime") endif if maShortTermXtrender < maShortTermXtrender[1] and maShortTermXtrender[1] > maShortTermXtrender[2] then drawtext("●",barindex,maShortTermXtrender,dialog,bold,14) coloured("red") endif if longTermXtrender> 0 then if longTermXtrender > longTermXtrender[1] then rrr=0 ggg=255 else rrr=0 ggg=100 endif else if longTermXtrender > longTermXtrender[1] then rrr=255 ggg=0 else rrr=100 ggg=0 endif endif if longTermXtrender > longTermXtrender[1] then macollongXtrenderColr=255 macollongXtrenderColg=0 else macollongXtrenderColr=0 macollongXtrenderColg=255 endif return shortTermXtrender style(histogram) coloured(r,g,0,150) as "B-Xtrender Osc. - Histogram", maShortTermXtrender as "B-Xtrender Shadow" coloured("black") style(line,5), maShortTermXtrender as "B-Xtrender Color" coloured(rr,gg,0) style(line,3), longTermXtrender style(histogram,1) as "B-Xtrender Trend - Histogram" coloured(rrr,ggg,0,20), longTermXtrender as "B-Xtrender Trend - Shadow" coloured("black",80) style(line,5), longTermXtrender as "B-Xtrender Trend - Line" coloured(macollongXtrenderColr,macollongXtrenderColg,0,80) style(line,3) |
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 :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
very interesting, i red the article. Nicolas are you going to create an automated strategy based on that? I will appreciate and I’d like to test it!!!
Con la programmazione assistita, ho generato questi due screener, uno long e l’altro short. Le strategie non ho ancora provato a crearle. Posto i due screener e aspetto qualche commento. A me pare funzionino nel cercare titoli adatti, non
ho provato con indici, forex e altro. Un saluto
indicator1 , ignored , ignored , ignored , ignored , ignored = CALL
“PRC_B-Xtrender” (close )
c1 = (indicator1 [1] >= indicator1 [2])
indicator2 , ignored , ignored , ignored , ignored , ignored = CALL
“PRC_B-Xtrender” (close )
c2 = (indicator2 >= 0)
ignored , ignored , ignored , indicator3 , ignored , ignored = CALL
“PRC_B-Xtrender” (close )
c3 = (indicator3 [1] >= indicator3 [2])
ignored , ignored , ignored , indicator4 , ignored , ignored = CALL
“PRC_B-Xtrender” (close )
c4 = (indicator4 >= 0)
SCREENER [c1 AND c2 AND c3 AND c4] ((close /DClose (1)-1)*100 AS
“% Var ieri” )
indicator1 , ignored , ignored , ignored , ignored , ignored = CALL
“PRC_B-Xtrender” (close )
c1 = (indicator1 [1] <= indicator1 [2])
indicator2 , ignored , ignored , ignored , ignored , ignored = CALL
"PRC_B-Xtrender" (close )
c2 = (indicator2 <= 0)
ignored , ignored , ignored , indicator3 , ignored , ignored = CALL
"PRC_B-Xtrender" (close )
c3 = (indicator3 [1] <= indicator3 [2])
ignored , ignored , ignored , indicator4 , ignored , ignored = CALL
"PRC_B-Xtrender" (close )
c4 = (indicator4 <= 0)
SCREENER [c1 AND c2 AND c3 AND c4] ((close /DClose (1)-1)*100 AS
"% Var ieri" )
Hello Nicolas, I’d like to know why you chose to use simple average functions to define shortTermXtrender and longTermXtrender while Bharat Jhunjhunwala in the article you pointed out was using exponential average functions. Thank in advance for your answer. Gabriel
The average used are EMA already, average[shortl1,1]
1 stands for Exponential.
I suspected something like this but in the PRT documentation I couldn’t find anything to explain the second parameter of the “average” function. So I suppose that by using this second parameter we can define other types of averages in the same way. Anyway, thank you for your quick response.
Bonjour Nicolas,
Peux tu nous expliquer le principe de fonctionnement ? Ou nous mettre un lien vers l’explication ?
Te remerciant par avance
Le lien vers l’article IFTA de l’auteur est dans le post déjà 🙂
Very poweful indeed. It deserves close attention. I really appreciate very much IFTA background, Thanks.