Hi – Here’s a simple bit of moving average code. Rather than have the last column as RSI, is it possible to have a column that shows a count for how many periods the screener condition has been met?
MyMa1=average[8](Close)
MyMa2 = average[13](Close)
MyRSI=RSI[14](Close)
CloseA=Close
CloseB=Close[1]
REM Close1=Close[1]
c1=CloseA>MyMa1
c2=CloseA>MyMa2
c3=CloseB>MyMA1
REM c2=Close1>MyMa1
SCREENER [c1 AND c2 AND c3] (MyRSI AS "RSI")
Please use the ‘Insert PRT Code’ button when putting code in your posts as it makes it much easier for others to read. I have tidied up your post for you. 🙂
This version of the screener, it should make a count of how many times the “test” condition was true and display it in the criteria column:
MyMa1=average[8](Close)
MyMa2 = average[13](Close)
//MyRSI=RSI[14](Close)
CloseA=Close
CloseB=Close[1]
REM Close1=Close[1]
c1=CloseA>MyMa1
c2=CloseA>MyMa2
c3=CloseB>MyMA1
REM c2=Close1>MyMa1
test = c1 AND c2 AND c3
if test and test[1] then
count=count+1
else
count=0
endif
SCREENER [test] (count)
You’re now on my Christmas card list…..
Glad to know it! Got plenty of things in my Amazon wish list 😆