Nested condition seems not to work

Forums ProRealTime English forum ProScreener support Nested condition seems not to work

  • This topic has 10 replies, 3 voices, and was last updated 6 years ago by avatarLeo.
Viewing 11 posts - 1 through 11 (of 11 total)
  • #60362
    Leo

    Hi,

    I am trying to filter data in a screener script in which I use another custom made indicator by the call function. After that I made a condition, but in the results there are items which should not be destilled. Is the code below correct anyway? Are nested clausule possible?

    By the way, is there a Debug option in Proscreener in which I can verify why results are destilled?

    Any help is appreciated.

    #60369

    ProScreener does not support GRAPH to debug. You should convert your code to a temp strategy to debug it.

    Since line 2 has an AND operator, for c10 to be true the condition

    must ALWAYS be true, in addition to eventually other OR conditions. The correct use of parenthesis will be beneficial to your code.

    Roberto

    #60374
    Leo

    Hi,

    Thanks for reply. I used the AND clause wrong. I changed it to below, but still some items in the results should not be there, i.e. bar[0] has a value of “27”  and bar[1] has a value of “6” for indicator10, so c10 should have a result of false (or -1?), shouldn’t it?

    any tips appreciated.

    #60379

    What is the “DS” indicator please? Could you post a screenshot?

    #60458
    Leo

    Hi,

    Attached the DS indicator.

    #60460

    It’s not possible to analyze the indicator without the complete source code.

    I attach a screenshot of a table of different values (not all possible variations) where I replaced the conditions with some values.

    I also highlighted some odd (though they may well be right) conditions, where you test INDICATOR[0] both against 10 and 15.

    I don’t know whether your indicator is right or wrong, but you should thoroughly test your conditions to make sure they reflect what you want.

     

    1 user thanked author for this post.
    #60474

    Your called indicator “CALL” another one named “QUICK”.. This is difficult to know how the whole thing is combined to give result in your screener. Please post the code in text format next time, much easier for us to help with a simple copy/paste of your codes into our own platform! 😐

    #60478
    Leo

    Hi Nicolas,

    Appreciating your help! About the OR/AND clause test data: It is what I want. Or candle[0] needs to be below a particular value, or candle[1] needs that to be, but then candle[0] must not having a specific high value anymore.
    I attached the DS indicator in text now. If you could take another look would be great help. The screener destills this stock: AMT. But that stock has candle[0]=28.7 and candle[1]=7.76 in the weekly chart. Using this code in proscreener script:

    should filter AMT in my opinion.

    #60480

    This is the DS indicator, but we also need the “QUICK” one (line 18 of the DS indicator).

    #60485
    Leo

    Attached.

    #61110
    Leo

    Hi Nicolas,

    Any news on this issue?

    cheers, Leo

Viewing 11 posts - 1 through 11 (of 11 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login