Hello
I’m having trouble getting the screener to look for two outcomes within the same command. I’m trying to find stocks that with a close above/below the highest/lowest weekly close over the past 13 weeks, with weekly averages in order, but combined with an ROC [13] greater than +30 for the highest, and -30 for the lowest, yet when I run the screener I’m not getting the same results as running the highest / lowest variants under separate screeners? Any help appreciated! Thanks
Timeframe(Weekly)
C2 = close > 2.00
Indicator2 = Volume
Indicator3 =(highest[26](volume[1]))
C3 = indicator2 > indicator3
Indy4 = exponentialaverage[13](close)
Indy5 = exponentialaverage[39](close)
c4 = (indy4 <= Indy5)
Indy6 = (lowest[13](low[1]))
c5 = (close <= Indy6)
criteria = volume
///Long
Indy6 = exponentialaverage[13](close)
Indy7 = exponentialaverage[39](close)
c6 = (indy6 >= Indy7)
Indy6 = (highest[13](high[1]))
c7 = (close >= Indy6)
criteria = volume
Filter = ROC[13](close) >30
Filter1 = ROC[13](close) <-30
Screener [c2 and c3 and (c4 and c5 and filter1) or c2 and c3 and (c6 and c7 and filter)] (criteria as "volume")
It may be due to the way conditions are combined with relational operators.
How do you want to combine them?
Hi Robert
I’m not sure I understand? All I want the screener for is to show both the longs and shorts possible screening for the criteria listed. Or would it be better to split into two screeners, one long and one short?
Thanks
Conditions involving relational operators can behave differently according to the use of parentheses. Try this as line 26, inside SCREENER’s brackets:
(c2 and c3 and c4 and c5 and filter1) OR (c2 and c3 and c6 and c7 and filter)
In any case, I tested your original code and it just returned about ten signals on the weekly TF, selecting shares from UK, USA, Germany and Italy.
Thanks Robert. That makes sense now!!! 😉