Advice on combining conditions

Viewing 15 posts - 16 through 30 (of 48 total)
  • Author
    Posts
  • #51672 quote
    thetragiccircle
    Participant
    Junior

    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 !

    #51687 quote
    thetragiccircle
    Participant
    Junior

    In 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

    P1.png P1.png
    #51703 quote
    Nicolas
    Keymaster
    Master

    You can make a new variable that will make the sorting criteria depending of the signal type (long=+1 or short=-1):

    //to add into your own screener code: 
    if shortconditions then 
     criteria = - 1
    elsif longconditions then 
     criteria = 1
    endif 
    
    screener [shortconditions or longconditions] (criteria as "long or short?")
    thetragiccircle thanked this post
    #51715 quote
    thetragiccircle
    Participant
    Junior

    Brilliant, 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?

    PRT.png PRT.png
    #51764 quote
    thetragiccircle
    Participant
    Junior
    // SHORT
    TIMEFRAME(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)
    //LONG
    TIMEFRAME(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

    #51765 quote
    thetragiccircle
    Participant
    Junior

    Sorry 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

    #51774 quote
    robertogozzi
    Moderator
    Master

    You just have to name your screener the same as the text you want to be displayed.

    thetragiccircle thanked this post
    #51808 quote
    thetragiccircle
    Participant
    Junior

    Sorry 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

    prt1.png prt1.png
    #51827 quote
    thetragiccircle
    Participant
    Junior

    I 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….”?

    #51828 quote
    robertogozzi
    Moderator
    Master

    You 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.

    thetragiccircle thanked this post
    x-screener.png x-screener.png
    #51833 quote
    thetragiccircle
    Participant
    Junior

    Thanks Roberto….its not important I suppose…no need to have it there twice !

    Any advice on the short/long variable?

    #51847 quote
    robertogozzi
    Moderator
    Master

    I could not suggest more than Nicolas said and wrote!

    thetragiccircle thanked this post
    #51849 quote
    thetragiccircle
    Participant
    Junior

    Thank 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)

    #51851 quote
    robertogozzi
    Moderator
    Master

    Ok, that’s how it should go, please try and let me know:

    criteria = 0
    // SHORT
    TIMEFRAME(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 THEN
       criteria = -1
    ENDIF
    //LONG
    TIMEFRAME(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 THEN
       criteria = 1
    ENDIF
    SCREENER[criteria](criteria as "long or short?")
    thetragiccircle thanked this post
    #51853 quote
    thetragiccircle
    Participant
    Junior

    Hi Roberto, I have tested it and it is not returning short signals only longs. Is line 15 in the correct place?

Viewing 15 posts - 16 through 30 (of 48 total)
  • You must be logged in to reply to this topic.

Advice on combining conditions


ProScreener: Market Scanners & Detection

New Reply
Author
Summary

This topic contains 47 replies,
has 3 voices, and was last updated by thetragiccircle
8 years, 3 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 10/22/2017
Status: Active
Attachments: 7 files
Logo Logo
Loading...