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/06/2017 at 4:05 PM #51672
Yes, you are totally correct and I am wrong…..I see the error of my ways and it is because the { and the [ are on the same key, and with my poor eyesight, I did not notice !
11/06/2017 at 4:43 PM #51687In the 6th post to this thread, dated October 23rd at 4.35, you replied following my query concerning the possible flagging of any returning signal as a long ( ) or short (-)
This is the result of combining the two indicators, though you can only return ONE criteria and there’s no way to change the displayed data to tell between long and short.
In the screenshot below is an example of a screener I already have, where it is proprietary and unfortunately entry to the code is prohibited, but in the Proscreener table, it does show the name of the screener (ie Porsche3.0), …I have also circled where it has returned 2 short signals by means of a – prefix, whereas the long signals have none.
Can you direct me to anywhere in an instruction manual where I could learn how to modify the screener which you joined together for me, so I could add its name in the area similar to the screenshot below, and also to prefix a minus sign to a short signal return?
Thanks again
David
11/06/2017 at 5:07 PM #51703You can make a new variable that will make the sorting criteria depending of the signal type (long=+1 or short=-1):
12345678//to add into your own screener code:if shortconditions thencriteria = - 1elsif longconditions thencriteria = 1endifscreener [shortconditions or longconditions] (criteria as "long or short?")1 user thanked author for this post.
11/06/2017 at 5:53 PM #51715Brilliant, thank you so much…does this variable get added as it is to the area where I have circled after the last line?, ie at the end?
11/07/2017 at 10:14 AM #51764Short and Long code123456789101112131415161718192021222324// SHORTTIMEFRAME(15 minutes)indicator1, ignored, ignored = CALL "Pro-OBS"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)//LONGTIMEFRAME(15 minutes)indicator1a, ignored, ignored = CALL "Pro-OBS"c1a = (indicator1a <= 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)SCREENER[(c1 AND c2 AND c3) OR (c1a AND c2a AND c3a)] (Variation AS "%Chg prev bar")As per my last post..here is the code to which I wish the new variable attached, to return a -1 for short and 1 for long signal. Thanks
11/07/2017 at 10:17 AM #51765Sorry to be complicated but is there a code for adding my name of the screener in the box at the top of the proscreener table as in my screenshot at 4.43 yesterday? I would like to add the name “Lotus15” if at all possible. Thanks yet again. David
11/07/2017 at 10:57 AM #51774You just have to name your screener the same as the text you want to be displayed.
1 user thanked author for this post.
11/07/2017 at 1:34 PM #51808Sorry I dont understand that, I have named my screener as such but it does not appear in the proscreener table, for example in the bar as in the attached screenshot.
Compare that to the attachment P1 at 4.43 yesterday…that is what I am trying to acheive, as well as trying to figure out where to put the variable code to return -1 for short signals and 1 for longs as per the post at 5.53 yesterday.
Thanks again
11/07/2017 at 3:37 PM #51827I asked…S.orry I dont understand that, I have named my screener as such but it does not appear in the proscreener table, for example in the bar as in the attached screenshot.
I think I now see it……Does that mean the screener name goes into the last line between brackets, starting “Variation AS….”?
11/07/2017 at 3:42 PM #51828You can use that part if the name, if the name of thye screener box above is not what you want, as I hilightened in the attached pic.
1 user thanked author for this post.
11/07/2017 at 4:18 PM #51833Thanks Roberto….its not important I suppose…no need to have it there twice !
Any advice on the short/long variable?
11/07/2017 at 6:10 PM #5184711/07/2017 at 6:39 PM #51849Thank you, but you cannot tell me where to place the variable within the code? (see posts 5.07, 5.53 yesterday and 10.14 today)
11/07/2017 at 7:13 PM #51851Ok, that’s how it should go, please try and let me know:
12345678910111213141516171819202122232425262728293031criteria = 0// SHORTTIMEFRAME(15 minutes)indicator1, ignored, ignored = CALL "Pro-OBS"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)indicator1a, ignored, ignored = CALL "Pro-OBS"c1a = (indicator1a <= 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?")1 user thanked author for this post.
11/07/2017 at 7:56 PM #51853Hi Roberto, I have tested it and it is not returning short signals only longs. Is line 15 in the correct place?
-
AuthorPosts
Find exclusive trading pro-tools on