A request that was addressed to ProRealTime:
Hello,
I would like to create a screener that accomplishes the following.
Screener Short :
1. The current closing price is below the 50 day simple moving average.
2. The 50 day simple moving average is lower than 5 days ago.
3. The 20 day simple moving average is below the 50 day simple moving average.
4. The Stochastic [8,3] has to be greater than 60. If it then falls by 5 points that’s when we want to get a screener result.
//Short-Screener:
c1 = (close < Average[50](close))
c2 = (Average[50](close) < Average[50](close)[5])
c3 = (Average[20](close) < Average[50](close))
c4 = Stochastic[8,3](close) > 40
SCREENER[c1 AND c2 AND c3 AND c4] ((close/DClose(1)-1)*100 AS "%Chg yest.")
Suggestion for an anwser:
//Short-Screener
avg50=Average[50](close)
avg20=Average[20](close)
mystochastic=Stochastic[8,3](close)
if mystochastic crosses over 60 then
maxvalue=mystochastic
elsif mystochastic > 60 then
maxvalue=max(maxvalue,mystochastic)
endif
c1 = (close < avg50)
c2 = (avg50 < avg50[5])
c3 = (avg20 < avg50)
c4 = mystochastic > 60 and mystochastic > maxvalue-5
SCREENER[c1 AND c2 AND c3 AND c4] ((close/DClose(1)-1)*100 AS "%Chg yest.")