in MT5, is there a way to stop optimization at predefined number of iterations without manually seeing the number and pressing the Stop button?

 
Hello, in MT5, is there a way to stop optimization at predefined number of iterations without manually seeing the number and pressing the Stop button? 
 
driven: Hello, in MT5, is there a way to stop optimization at predefined number of iterations without manually seeing the number and pressing the Stop button? 
I'm not sure, but it may be possible — Documentation on MQL5: Working with Optimization Results
 
driven is there a way to stop optimization at predefined number of iterations

That makes no sense. If you stop it early, you do not have an optimization.

 
William Roeder #:

That makes no sense. If you stop it early, you do not have an optimization.

I do not want 10,000 iterations, I just want 3,000 of them - it is sufficient for me.  
 
driven #: I do not want 10,000 iterations, I just want 3,000 of them - it is sufficient for me.  

Then consider using "Genetic" optimisations instead.

Or reduce your input ranges (start, step. stop) and select fewer inputs to optimise.

 
Fernando Carreiro #:

Then consider using "Genetic" optimisations instead.

Or reduce your input ranges (start, step. stop) and select fewer inputs to optimise.

Yes, I am paying to use MT5 Cloud Servers and am using genetic and 1 min OHLC and few parameters but do get 10,000 iterations(as an example). I was hoping I can stop at 3,000, but there is no way in MT5 without programming it. Correct?     
 
driven #: Yes, I already use genetic and 1 min OHLC and few parameters but do get 10,000 iterations(as an example). I was hoping I can stop at 3,000, but there is no way in MT5 without programming it. Correct?     

If you are getting 10000 even after selecting genetic optimisations, then you are using way too many inputs or using too many steps for each input. You need to be more smart about your selections.

If your strategy has so much too optimise, then chances are that it will fail in real trading. You will end up curve fitting which will only look good in back-tests but do badly going forward.

 
Fernando Carreiro #:

If you are getting 10000 even after selecting genetic optimisations, then you are using way too many inputs or using too many steps for each input. You need to be more smart about your selections.

If your strategy has so much too optimise, then chances are that it will fail in real trading. You will end up curve fitting which will only look good in back-tests but do badly going forward.

Every day I reoptimize 7 parameters for the best inputs during previous 2 weeks and trade it present day. I use step of 2-5 between inputs - it gives at least 10,000 iterations. 

I am successful at it and would like to reoptimize on  "Every Tick". I do not want to seat and wait until it gets to 3,000 iteration and then stop it manually.

Do not mind if it is curve fitting or not, it works for me....So my basic question is, is there a way to indicate how many iterations I would like?       

 
driven #:

Every day I reoptimize 7 parameters for the best inputs during previous 2 weeks and trade it present day. I use step of 2-5 between inputs - it gives at least 10,000 iterations. 

I am successful at it and would like to reoptimize on  "Every Tick". I do not want to seat and wait until it gets to 3,000 iteration and then stop it manually.

Do not mind if it is curve fitting or not, it works for me....So my basic question is, is there a way to indicate how many iterations I would like.       

If you have to source code, it's possible to add some workarounds (because even by code there is no direct command to stop an optimization).

Otherwise not possible to my knowledge.

 
driven #: Every day I reoptimize 7 parameters for the best inputs during previous 2 weeks and trade it present day. I use step of 2-5 between inputs - it gives at least 10,000 iterations. I am successful at it and would like to reoptimize on  "Every Tick". I do not want to seat and wait until it gets to 3,000 iteration and then stop it manually. Do not mind if it is curve fitting or not, it works for me....So my basic question is, is there a way to indicate how many iterations I would like.

Then write your code to self-optimise in real-time. Historical tick and bar data is available to the EA in real-time while trading.

So have the EA process that data during idle time and simulate or carry out virtual trades with various input parameter combinations.

You can keep a running database of these virtual trades with running metrics within a time period of analysis. Then you can have your EA select the best option at regular interval or continuously based on whatever metrics you wish to track.

If I remember correctly, there should be an example of such an EA in the Articles that does self-optimsation on a moving average strategy.

EDIT: Instead of keeping a database, you can instead use incremental calculations using exponential moving averages of the metrics. This way, there is no extra storage space requirements and CPU overhead is low, and you have the metrics available for continuous adaptation of your strategy.

 
driven #: Thank you for your answer.. I posted another question under different subject ..please look at it   
The answer is the same!
Reason: