LookBack = 20
if barindex >= 26 then
LL = lowest[LookBack](low)
HH = highest[LookBack](high)
StEMA12 = (Average[12,1](close) - LL) / (HH - LL)
StEMA26 = (Average[26,1](close) - LL) / (HH - LL)
StMACD = (StEMA12 - StEMA26) * 100
SigLine = Average[9,1](StMACD)
hhmacd = max(sigline,max(hhmacd,stmacd))
llmacd = min(sigline,min(llmacd,stmacd))
macdperc = ((stmacd-llmacd)/(hhmacd-llmacd))*100
sigperc = ((sigline-llmacd)/(hhmacd-llmacd))*100
endif
Result = 0
IF macdperc >= 80 THEN //OverBought
Result = 1
ELSIF macdperc <= 20 THEN //OverSold
Result = 2
ENDIF
SCREENER[Result](Result AS "1=Ob, 2=Os")