I have a minor bug fix for the indicator that can be found in the library here:
Every Fractal trend lines
The ITF file attached here corrects an issue whereby the indicator crashes if you enter a value for ‘Qty’ that is greater than the number of fractals detected.
Here is the updated code:
//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
myqty = min(min(b,a),qty)
for z = 0 to myqty-1
e = (myqty)-z
if fade then
c = (255/myqty)*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