Iteration number limitations in strategy tester optimization

 

There are limitations in mt5, if the product of the iterations numbers of the parameters for optimization is bigger than 100 million or so, it will only run a genetic algorithm, regardless if a full optimization was selected. Seems to be an internal bug, makes owning your own fancy expensive server useless. It would have been nice if metaquotes list the limitations of their product.

As genetic algorithm doesn't do load balancing, only distributes passes for different agents, some will finish earlier, some later, depending on the parameters of the algorithm, therefore the overall runtime will increase. They could redistribute the remaining tasks to try balancing the load. It would be okay, if it would actually find the global maximum, but it settles on the local maximum.

Compared to this a full optimization always keeps the agents busy, and guaranteed to find the best solution, although it would take longer/needs server farm with thousands of agents. (with decommissioned servers it is in reach).


Also, I used the example https://www.mql5.com/en/articles/746 to reduce only which results to be saved. Seems like the FrameAdd() functions suffers from similar limitation, if the combined iteration number is bigger than a value, it simply doesn't work, even though it returns true, FrameNext() will return 0 for pass number, constantly.


I wrote to metaquotes, they asked me to write here. Question: does anyone know of another trading software which is more usable? Open source?

MQL5 Cookbook: Saving Optimization Results of an Expert Advisor Based on Specified Criteria
MQL5 Cookbook: Saving Optimization Results of an Expert Advisor Based on Specified Criteria
  • www.mql5.com
We continue the series of articles on MQL5 programming. This time we will see how to get the results of each optimization pass during the Expert Advisor parameter optimization. The implementation will be done so as to ensure that if a certain condition specified in the external parameters is met, the corresponding pass values will be written to...
 
pcdeni:

There are limitations in mt5, if the product of the iterations numbers of the parameters for optimization is bigger than 100 million or so, it will only run a genetic algorithm, regardless if a full optimization was selected. Seems to be an internal bug, makes owning your own fancy expensive server useless. It would have been nice if metaquotes list the limitations of their product.

From MetaTrader Help :

The genetic optimization mode is automatically enabled when the total number of optimization steps exceeds 100 million.

You have to deal with it. It's not that hard to work around it, but is it really needed ?

As genetic algorithm doesn't do load balancing, only distributes passes for different agents, some will finish earlier, some later, depending on the parameters of the algorithm, therefore the overall runtime will increase. They could redistribute the remaining tasks to try balancing the load. It would be okay, if it would actually find the global maximum, but it settles on the local maximum.

Compared to this a full optimization always keeps the agents busy, and guaranteed to find the best solution, although it would take longer/needs server farm with thousands of agents. (with decommissioned servers it is in reach).

I think you don't understand how the genetic algorithm is working. It's not possible to "always keeps the agents busy" with GA. It's not a MT issue, it's due to the GA architecture which works in several passes, you can't start a new pass before the current one is done. That doesn't mean there is no place for improvements but there is structural limitation.

Not all problems are suitable for the GA, I have a serious thinking that if you need more than 100 millions step, you most probably have to split your problem in several chunks.

Also, I used the example https://www.mql5.com/en/articles/746 to reduce only which results to be saved. Seems like the FrameAdd() functions suffers from similar limitation, if the combined iteration number is bigger than a value, it simply doesn't work, even though it returns true, FrameNext() will return 0 for pass number, constantly.

Unless you are using a beta which can more likely contains new bugs, I am working with Frames and it works very well if you use them properly. (The documentation is quite limited so it's easy to misuse them). You can eventually search the forum for existing topics about frames usage.
Strategy Optimization - Algorithmic Trading, Trading Robots - MetaTrader 5
Strategy Optimization - Algorithmic Trading, Trading Robots - MetaTrader 5
  • www.metatrader5.com
The Strategy Tester allows you to test and optimize trading strategies (Expert Advisors) before using them for live trading. During testing, an Expert Advisor with initial parameters is once run on history data. During optimization, a trading strategy is run several times with different sets of parameters which allows selecting the most...
 

Dear Alain

I started reading your reply, clicked on the link of metatrader help, and searched for the quoted term:

The genetic optimization mode is automatically enabled when the total number of optimization steps exceeds 100 million.

I don't know why you wrote this, could it be a mixup? I was talking about a local cloud, not the cloud network. The quoted part is in a subchapter that deals with the cloud network. I think you confuse things. Perhaps you should recheck them before clicking on the add comment button. There is even a link in that chapter that redirects you to the cloud network's website. I really don't understand, why you mix things, it will only confuse people.

Any serious replies please?

 
I do understand how a genetic algorithm works, and when I see almost all - except one - agents finished, and that one agent has 10-20 passes left, I keep wondering if others understand them as well?
 

I used the frames implementation from the link above. It does work for smaller iteration numbers. After that and a lot of debugging it turns out that the code is not broken, but frameadd doesn't send any frames. As printing and commenting is not working in the ontester function, I used file writing, and it returns true, while framenext returns pass number 0, with no data in it. Dude, you should seriously consider to fill the need, instead of dictating unwanted needs, covering up flaws, etc. It is very disrespectful to treat anybody in a way you just did. Assuming I am silly, mixing multiple things together, and hoping I won't notice the difference. Instead of reasoning why and where limitations rationally could have arise, saying that it is perfect and solve it yourself... It is unacceptable as an engineer, this attitude. Why do you want to live in the problem, why don't you want to be part of the solution?

Let me ask you, if you would have a hole on your fuel tank in your car, would you go to fix it, or would you just go more often to the petrol station to ensure there is always enough fuel? 

 
I hope you will find quickly an other platform. I have rarely seen someone so arrogant and unpleasant.
Reason: