Advice on combining conditions
Forums › ProRealTime English forum › ProScreener support › Advice on combining conditions
- This topic has 47 replies, 3 voices, and was last updated 6 years ago by thetragiccircle.
-
-
11/07/2017 at 8:26 PM #51860
Sorry…I am confusing myself…ignore that last post. Thanks Roberto
11/07/2017 at 8:28 PM #51861Line 15 (as well as line 30) is ENDIF, it should not affect any other line.
The logic is fine, I can’t see where that issue may originate.
It might be possible that both SHORT and LONG conditions arise at at the same time on the same candlestick and since the LONG side is below the SHORT one, the value in line 14 is overridden by the value in line 29. But if this is the case there is some error in the logic of the screener.
1 user thanked author for this post.
11/07/2017 at 8:29 PM #51862Ok, don’t worry.
1 user thanked author for this post.
11/07/2017 at 11:06 PM #51871Hi Roberto, I have tested it and it is not returning any signal which would be a short. Every long is returned ok.
I have also run the same code and conditions but with 5 min / 15 min / 1hour timeframes and the same….long signals but no shorts at all, and that is scanning 30 instruments.
11/07/2017 at 11:19 PM #51872Please attach the Pro-OBS indicator (attach the .ITF file or copy & paste the code), so that I can test it.
On which instruments and TFs are you using it?
1 user thanked author for this post.
11/08/2017 at 8:58 AM #51888Hi Roberto,
I cannot provide the ProOBS code as that indicator is locked.
I ran the code over 30 pairs, including all major FX pairs, Euro, AUD, NZD and major indices, oil, and gold…..always just a long signal is returned.
I ran the screener over the 15/60/240 times frames. I also copied the code and adjusted the timeframes to give an identical scanner signal over the 5/15/60 timeframes.
I altered the last line ..Variation as “%change etc ” by substituting the word “Lotus” so it reads in the top bar of the proscreener table.
I also noticed that every time I made a NEW scanner with this code, it returned only long signals….and when I switched off PRT and logged back in, any NEW scanner (with the code you gave), has disappeared from the Proscreener list completely.
Confused now!….Thanks Roberto
11/08/2017 at 9:18 AM #51890And if I remove the first line of code, ie criteria = 0, I receive all the short signals as well as the long ones, but there is no – prefix, only “1” signals.
11/08/2017 at 10:36 AM #51912I don’t know the logic of your scanner and without the original indicator I cannot duplicate what you are saying, but it seems the way (and where) I placed variable “criteria” is fine.
Sorry, but at this point you will have to keep the two scanners separate, or keep them as they are without being able to tell Shorts from Longs until you click on the pair to open the chart.
1 user thanked author for this post.
11/08/2017 at 3:02 PM #51949Thanks Roberto…I will try and duplicate the locked indicator settings using Stochastic, and see if that works.
11/08/2017 at 4:18 PM #51977Replaced ProOBS with Stochastic12345678910111213141516171819202122232425262728293031criteria = 0// SHORTTIMEFRAME(15 minutes)indicator1 = Stochastic[5,2](close)c1 = (indicator1 >= 80)TIMEFRAME(1 hour)indicator2 = MACDline[12,26,9](close)c2 = (indicator2 <= 0)TIMEFRAME(4 hours)indicator3 = ExponentialAverage[9](MACDline[12,26,9](close))indicator4 = MACDline[12,26,9](close)c3 = (indicator3 >= indicator4)IF c1 AND c2 AND c3 THENcriteria = -1ENDIF//LONGTIMEFRAME(15 minutes)indicator1 = Stochastic[5,2](close)c1a = (indicator1 <=20)TIMEFRAME(1 hour)indicator2a = MACDline[12,26,9](close)c2a = (indicator2a > 0)TIMEFRAME(4 hours)indicator3a = ExponentialAverage[9](MACDline[12,26,9](close))indicator4a = MACDline[12,26,9](close)c3a = (indicator3a <= indicator4a)TIMEFRAME(default)IF c1a AND c2a AND c3a THENcriteria = 1ENDIFSCREENER[criteria](criteria as "long or short?")Hello again,
I have replaced the ProOBS indicator which is locked, with Stochastic from the PRT Indicator list….it still only returns long signals
11/09/2017 at 11:28 AM #52090Sorry, I can’t detect any logic error.
1 user thanked author for this post.
11/10/2017 at 4:31 PM #52274It 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)?
11/15/2017 at 4:36 PM #5284911/20/2017 at 8:12 PM #53341Hi I have been trying to get a response as above…..I see you cannot find a logic error….why does it only return long signals?…what am I doing wrong? is there any “guide” from PRT to explain better how to resolve this myself?
Thanks
11/23/2017 at 7:50 AM #53680How much long signals do you get at the same time in ProScreener window?
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on