abnormal behavior of if… and ..and ..and condition

Forums ProRealTime English forum ProOrder support abnormal behavior of if… and ..and ..and condition

Viewing 2 posts - 1 through 2 (of 2 total)
  • #92284

    Let’s say

    the result will be totally different from:

    I found this abnormal behavior when I do my experiment on Nicolas’s nice post (This abnormal behavior is nothing to do with the code of Nicolas’s post. I show the post here is just to give a code base for a quick experiment):

    https://www.prorealcode.com/blog/learning/how-to-improve-a-strategy-with-simulated-trades-1

    First, you can change the code block (at # line: 22):

    into:

    or

     

    and run both. You can easily see the difference.

     

    note that logic of code blocks is equivalent to:

    You may switch each position of those conditions around. (and see the abnormal when buysignal is in 1st or 2nd position)

     

    I don’t know whether such abnormal is due to PRT’s intrinsic bug or maybe there is a basic rule for if… condition that I don’t know yet.

     

    Does someone know the cause? And how to avoid such unpredictable behavior?

     

    ps. also there is a bug in backtesting when running for i=0 to aNumberLargerThan500, the “i” will never exceed 500. Everyone can reproduce it by putting this code into backtesting :

    Is this bug will be fixed on next PRT version?

     

    Thanks!

     

    #92286

    Hi waid, thanks for the feedback about this issue. I moved your topic in the ProOrder forum since it is related to coding. I have no time now, but I will look deeper into your explanation by tomorrow.

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

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