Maximum code length & max number of IF's

Forums ProRealTime English forum ProBuilder support Maximum code length & max number of IF's

Viewing 5 posts - 1 through 5 (of 5 total)
  • #44307

    Does anyone know what the maximum of IF’s are allowed within one strategy before it gets “confused”? And what is the max length of the code.

     

    I wonder if I can put as many conditions in one strategy as I only require. And what would be you suggestion to make the code less cluttered as possible?

    #44337

    I have not yet run into issues with the number of If and even nested if statements used (or lines of code for that matter).

    But I do experience issues when using 2 or more loops (however number of iterations could maybe also play a role).

    1 user thanked author for this post.
    #44341

    I tried this one time and I believe the maximum amount of IF statements/actions per iteration is something like 1000-2000. As for maximum code length it is somewhere around 10000-20000 lines of code I believe. If you really want to know you can test it yourself.

    1 user thanked author for this post.
    #44342

    Here you may want to find clues and hints on some improvements for screeners (and strategies as well): https://www.prorealcode.com/blog/learning/speed-calculation-indicator/

    Too many nested IFs can lead to slower execution and, maybe, some interpretation issues. It is preferrable to use multiple conditions on the same line, example:

     

    1 user thanked author for this post.
    #44375

    …I think long before you have reached the point that PRT gets “confused” you will reach a point that backtesting your strategy is painfully slow.

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

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