I made some notes within the code…. hope this helps a little.
//Every Fractal v1.4
//PRT v11
//By Vonasi
//Date: 20200331
//Settings
//Qty = 1
//StartBack = 0
//Past = 1
//Future = 1
//Points = 1
//Fade = 0
//BarsBefore = 1
//BarsAfter = 1
//Make sure all settings are valid ones
BarsBefore = max(BarsBefore,1)
BarsAfter = max(BarsAfter,1)
StartBack = max(0,startback)
//Make sure we have enough bars
if barindex >= barsbefore + barsafter then
//Look for a low fractal
BarLookBack = BarsAfter + 1
if low[BarsAfter] < lowest[BarsBefore](low)[BarLookBack] THEN
if low[BarsAfter] = lowest[BarLookBack](low) THEN
//Set low fractal array location
a = a + 1
//Store bar number and low value in two arrays at location a
$supportbar[a] = barindex[barsafter]
$supportvalue[a] = low[barsafter]
endif
endif
//Look for a high fractal
if high[BarsAfter] > highest[BarsBefore](high)[BarLookBack] THEN
if high[BarsAfter] = highest[BarLookBack](high) THEN
//Set high fractal array location
b = b + 1
//Store bar number and high value in two arrays at location b
$resistancebar[b] = barindex[barsafter]
$resistancevalue[b] = high[barsafter]
endif
endif
if islastbarupdate then
myqty = min(min(b,a),qty)
//Loop to draw correct number of lines
for z = 0 to myqty-1
e = (myqty)-z
//Calculate colour contrast setting based on number of lines being drawn
if fade then
c = (255/myqty)*e
else
c = 255
endif
//If drawing support lines
if support then
//Check that we have at least two low points stored
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 drawing resistance lines
if resistance then
//Check that we have at least two high points stored
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
endif
return