This indicator only works on PRTv11.
This indicator allows you to draw lines connecting every possible pair of fractals or swing highs and swing lows on the chart.
A line connecting two fractals in a row can be drawn into the future and/or into the past by setting ‘Future’ and/or ‘Past’.
A point marking the highs and lows of the connecting fractals can be displayed or removed using the ‘Points’ setting.
The quantity of fractals displayed can be selected by changing the value of ‘Qty’.
The type of fractal recognised can be changed by adjusting the ‘BarsBefore and ‘BarsAfter’ values. For example a high fractal consisting of 3 bars before and 2 bars after would be a high with three previous lower highs preceding it and two lower highs after it.
‘StartBack’ allows you to choose to show just previous fractals. A setting of zero displays from the latest fractal back. A setting of 1 would ignore the latest fractal and display fractals from the second most recent fractal and so on.
Using the ‘Fade’ setting will mean that the older a fractal is the paler the line and point is.
The settings ‘Support’ and ‘Resistance’ allow you to turn off or on the display of the upper or lower fractal lines.
I advise downloading the ITF file and importing into your platform to get full functionality.
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 |
//Every Fractal //PRT v11 //By Vonasi //Date: 20200331 //Qty = 1 //StartBack = 0 //Past = 1 //Future = 1 //Points = 1 //Fade = 0 //BarsBefore = 1 //BarsAfter = 1 BarsBefore = max(BarsBefore,1) BarsAfter = max(BarsAfter,1) StartBack = max(0,startback) BarLookBack = BarsAfter + 1 if low[BarsAfter] < lowest[BarsBefore](low)[BarLookBack] THEN if low[BarsAfter] = lowest[BarLookBack](low) THEN a = a + 1 $supportbar[a] = barindex[barsafter] $supportvalue[a] = low[barsafter] endif endif if high[BarsAfter] > highest[BarsBefore](high)[BarLookBack] THEN if high[BarsAfter] = highest[BarLookBack](high) THEN b = b + 1 $resistancebar[b] = barindex[barsafter] $resistancevalue[b] = high[barsafter] endif endif if islastbarupdate then for z = 0 to qty-1 e = (qty)-z if fade then c = (255/qty)*e else c = 255 endif if support then if a >= 2 then if future then drawray($supportbar[a-z-1-startback],$supportvalue[a-z-1-startback],$supportbar[a-z-startback],$supportvalue[a-z-startback])coloured(128,0,0,c) endif if past then drawray($supportbar[a-z-startback],$supportvalue[a-z-startback],$supportbar[a-z-1-startback],$supportvalue[a-z-1-startback])coloured(128,0,0,c) endif if points then drawpoint($supportbar[a-z-1-startback],$supportvalue[a-z-1-startback],2)coloured(128,0,0,c) drawpoint($supportbar[a-z-startback],$supportvalue[a-z-startback],2)coloured(128,0,0,c) endif endif endif if resistance then if b >= 2 then if future then drawray($resistancebar[b-z-1-startback],$resistancevalue[b-z-1-startback],$resistancebar[b-z-startback],$resistancevalue[b-z-startback])coloured(0,128,0,c) endif if past then drawray($resistancebar[b-z-startback],$resistancevalue[b-z-startback],$resistancebar[b-z-1-startback],$resistancevalue[b-z-1-startback])coloured(0,128,0,c) endif if points then drawpoint($resistancebar[b-z-1-startback],$resistancevalue[b-z-1-startback],2)coloured(0,128,0,c) drawpoint($resistancebar[b-z-startback],$resistancevalue[b-z-startback],2)coloured(0,128,0,c) endif endif endif next 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
Hi Vonassi
Thanks for all the good work.
I run PRT 11.1 (12 March 2020) but there’s an error when I launch the indicator. (Array problem). Any suggestion welcome.
I developed and tested on v11.1 – 1.8.0_202. All the array use in the code is very basic. Did you download and import the indicator? I have a minor bug fix to issue since it was posted in the library whereby the indicator crashes if the QTY is set higher than the number of fractals available. I will create a topic and post the new code and ITF file there and put a link here so that you can try that.
You can find the minor bug fix and new ITF file here:
https://www.prorealcode.com/topic/every-fractal-indicator-minor-bug-fix/
Hi Vonasi! Really nice work, is it possible to re-create this to work in 10.3? Best regards Anders
Thanks for the compliments. No this is not easily possible in v10.3 because it uses arrays which are not available in v10.3
Hi and thank you. I successfully imported original version above and added to my Prorealtime chart (version: 11.1 – 1.8.0_202). The indicator installed to a new pane and is blank. Can you guide me please on how to overlay on main chart please? Thank you, Bruce
Hi Vonasi,
The indicator is working like a charm on PRT v12; trying to adapt it for a strategy, I have found an issue: how to convert the drawpoint to a condition that identifies the point that can be used later in the strategy. Could you have a suggestion for me, please?