It must be something to do with the addition of the variable, because without it, the screener returns both longs and shorts. As I have mentioned, ..if the variable is added, it returns only potential long signals.
My expectations of this screener is that it is based on giving a signal which gives me a potential trade entry only when price enters the corresponding 15 minute overbought or oversold area of a Stochastic (or ProOBS) indicator.
ie…..The signal, (which could be a short) will only happen when the 15min chart enters an overbought area >80 (Stochastic or ProOBS indicator), when the 60 minute MACD indicator is already equal to or below the zero line, and when the 240 minutes MACD indicator is already red above green.
A potential long signal will conversely come about when the 15 min chart Stochastic (or ProOBS), enters below 20, when the 60 min MACD indicator is already equal to or more than the zero line, when the 240 minutes MACD indicator is already green above red.
The variable which would send a “1” signal only happens when the 15 min Stochastic (or ProOBS) falls below 20 when all the above conditions on the 60 minute and 240 timeframe are matched. (short)
The variable which would send a “-1” signal only happens when the 15 min Stochastic (or ProOBS) moves above 80 when all the above conditions on the 60 and 240 minute timeframes are matched. (long)
I cannot explain in more fuller detail as to what I am expecting this screener to return based on the above. I am obviously not saying that, contrary to your expertise, that there is a logic error, but certainly there is some factor, either omitted from, or within the code, which is resulting in only long signals being returned.
Would this make any difference if the timeframes were in reverse order? (240 condition, then 60 condition, and then 15 min condition)?