Hi there,
So, i’m trying to make this ProScreener code to identify when the Resistence and the Support have not been broken
To try and archive this, I tried taking this code here and adapted it into a ProScreener Code (code below)
Problem is, this only identifies patterns that have -already- happened in past candles, so with their support and/or resistence already surpassed.
How can I edit this so that it shows me those instances where neither the support nor the resistence have been broken yet?
period = 20
boxheight = 20
hh = highest[period](high)
ll = lowest[period](low)
if hh-ll <= boxheight*pointsize then
for i = 0 to period do
if high[i]=hh then
x2 = barindex[i]
endif
if low[i]=ll then
x1 = barindex[i]
endif
next
screener [ABS(x2-x1) >= period]
endif
Try this indicator to plot the lines:
DEFPARAM DrawOnLastBarOnly = true
Periods = 20
hh = highest[Periods](high[1])
ll = lowest[Periods](low[1])
DrawSegment(BarIndex[Periods],hh,BarIndex+1,hh) coloured(0,0,255,255) style (Line,3)
DrawSegment(BarIndex[Periods],ll,BarIndex+1,ll) coloured(255,0,0,255) style (Line,3)
RETURN //hh AS "Resistance",ll AS "Support"
and this screener:
Periods = 20
hh = highest[Periods](high[1])
ll = lowest[Periods](low[1])
SCREENER[(close <= hh) AND (close >= ll)]