LowestPrice50 = lowest[50](close)
LowBar50 = 0
for i = 1 to 50
if close[i] = LowestPrice50 then
LowBar50 = i
endif
next
LowestPrice20 = lowest[20](close)
LowBar20= 0
for i = 1 to 20
if close[i] = LowestPrice20 then
LowBar20 = i
endif
next
if LowestPrice20>LowestPrice50 AND LowBar50-Lowbar20>5 then
c1=1
else
c1=0
endif
HighestPrice50 = highest[50](close)
highBar50= 0
for i = 1 to 50
if close[i] = HighestPrice50 then
HighBar50 = i
endif
next
HighestPrice20 = highest[20](close)
HighBar20 = 0
for i = 1 to 20
if close[i] = HighestPrice20 then
HighBar20 = i
endif
next
if HighestPrice20>HighestPrice50 AND HighBar50-Highbar20>5 then
c2=1
else
c2=0
endif
if close crosses over average[20](close) then
c3=1
else
c3=0
endif
av=average[200](close)
c4 = summation[200](price<av)<1 // price trending below moving average
test = c1 and c2 and c3 and c4
SCREENER [test] (close as "close")