Advice on combining conditions

Viewing 15 posts - 31 through 45 (of 48 total)
  • Author
    Posts
  • #51860 quote
    thetragiccircle
    Participant
    Junior

    Sorry…I am confusing myself…ignore that last post. Thanks Roberto

    #51861 quote
    robertogozzi
    Moderator
    Master

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

    thetragiccircle thanked this post
    #51862 quote
    robertogozzi
    Moderator
    Master

    Ok, don’t worry.

    thetragiccircle thanked this post
    #51871 quote
    thetragiccircle
    Participant
    Junior

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

    #51872 quote
    robertogozzi
    Moderator
    Master

    Please 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?

    thetragiccircle thanked this post
    #51888 quote
    thetragiccircle
    Participant
    Junior

    Hi 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

    #51890 quote
    thetragiccircle
    Participant
    Junior

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

    #51912 quote
    robertogozzi
    Moderator
    Master

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

    thetragiccircle thanked this post
    #51949 quote
    thetragiccircle
    Participant
    Junior

    Thanks Roberto…I will try and duplicate the locked indicator settings using Stochastic, and see if that works.

    #51977 quote
    thetragiccircle
    Participant
    Junior
    criteria = 0
    // SHORT
    TIMEFRAME(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 THEN
    criteria = -1
    ENDIF
    //LONG
    TIMEFRAME(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 THEN
    criteria = 1
    ENDIF
    SCREENER[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

    #52090 quote
    robertogozzi
    Moderator
    Master

    Sorry, I can’t detect any logic error.

    thetragiccircle thanked this post
    #52274 quote
    thetragiccircle
    Participant
    Junior

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

    #52849 quote
    thetragiccircle
    Participant
    Junior

    Anyone?

    #53341 quote
    thetragiccircle
    Participant
    Junior

    Hi 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

    #53680 quote
    Nicolas
    Keymaster
    Master

    How much long signals do you get at the same time in ProScreener window?

    thetragiccircle thanked this post
Viewing 15 posts - 31 through 45 (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...