Maximum code length & max number of IF's
Forums › ProRealTime English forum › ProBuilder support › Maximum code length & max number of IF's
- This topic has 4 replies, 5 voices, and was last updated 7 years ago by Despair.
-
-
08/21/2017 at 1:20 PM #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?
08/22/2017 at 9:40 AM #44337I 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.
08/22/2017 at 10:38 AM #44341I 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.
08/22/2017 at 10:40 AM #44342Here 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:
12345678910111213141516// instead of:IF a THENIF b THENIF c THEN...ENDIFENDIFENDIF// it is preferrable to write:IF a AND b AND c THEN...ENDIF1 user thanked author for this post.
08/22/2017 at 5:19 PM #44375 -
AuthorPosts
Find exclusive trading pro-tools on