This indicator represents the last levels of fractals with boxes allowing to trade the breakouts of these zones of supports and resistances.
Boxes are created on the fly at each new bar. The indicator using loops being prone to heavy calculation, I suggest you use only a relatively weak lookback period (parameter to be changed in the indicator window).
It is possible to modify the transparency of boxes using the variable “alpha”, located at 100 by default (maximum = 255).The boxes can be of different colors by adjusting the MaxPipsBox setting highlighting red boxes larger than MaxBoxPips.
The indicator has been converted from a Metatrader4 version following a request from someone in the corresponding 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 44 45 46 47 48 49 50 51 |
//PRC_FractalsBox | indicator //08.02.2017 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge defparam drawonlastbaronly=true // --- settings LookBackBars = 100 MaxPipsBox = 0 MaxBoxPips = 15 alpha = 100 // --- end of settings //fractals cp = 2 if high[cp] >= highest[2*cp+1](high) then hil = high[cp] else hil=0 endif if low[cp] <= lowest[2*cp+1](low) then lol=low[cp] else lol=0 endif if barindex>LookBackBars then for li28 = LookBackBars downto 0 do if(hil[li28]<>0) then price4=hil[li28] endif if(lol[li28]<>0) then price12=lol[li28] endif if(MaxPipsBox and price4-price12>MaxBoxPips*pipsize) then r=240 g=0 b=0 else r=100 g=100 b=100 endif drawrectangle(barindex[li28+cp],price4,barindex[li28+cp+1],price12) coloured(r,g,b,alpha) next drawrectangle(barindex[0],price4,barindex[li28+cp+1],price12) coloured(r,g,b,alpha) endif return |
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
Toujours aussi prolifique Nicolas 😉 Ce sera donc du Darvas à la sauce Forex, excellent je prends …
Kinda reminds me of Renko Trading
Hi Nicolas, I’m having trouble changing the colours according to the instructions you gave. Could you explain please?
https://www.prorealcode.com/topic/mt4-fractal-box/
Bonjour
Merci pour ce code il m’apporte beaucoup par contre est il possible que tu réalises une version qui remplace les boites par des segments?
Merci d’avance, un fidèle de tes codes!!!
Matthieu
Merci, faire une demande dans le forum approprié.
Thanks for this good indicator Nicolas.
I would like to make the upper and lower limits more visible on the graph, and I change the last line “return” to “return price4, price12”, but unfortunately it draws both prices 2 bars later. Is there any way to draw both prices on the same bar than the rectangles?
because fractals are known 2 bars later! that’s why I used rectangle to plot them in the past.