Forums ProRealTime English forum ProOrder support Maximum number of lines of code in a strategy? Reply To: Maximum number of lines of code in a strategy?

#90843

I lowered my expectations of my ability to endure repetitive coding and have now coded a strategy of only 9623 lines! I wish we had arrays but then from discussions elsewhere on here I don’t think that the PRT engine could cope with the loops needed to fill the arrays with values anyway – so repetitive coding it is for now. I have now found out that find and replace is horribly slow when you try to replace thousands of items at a time!

So I now have a strategy that checks 400 combinations of variables x and y (10 to 200 in steps of 10) in a simulated strategy to see which combination of x and y has been the most profitable up to this moment in time. It then uses just the best set of variables in a very simple mean reversal strategy on the EURUSD Daily. First test results seem promising:

Screenshot_2-1

Screenshot_3-1

It appears that the values of 40 and 30 have been the most profitable since about mid 1995 which highlights to me that just looking at all time profitability might not be the best way to select variable values. So I am now working on a modified code with a third variable (p) in a loop that should allow me to base the decision on what look back period combined with what x and y values has been most profitable recently. Unfortunately this means modifying 400 different sections of code! I imagine the resulting strategy will be horrifically slow to compute as it will possibly be calculating 80000 possible combinations for every bar so I may have to lower my expectations again!

 

2 users thanked author for this post.