in the input tab, change STOP value to whatever you think is not insane/crazy XD, then the Optimizer won't exceed that value
Thanks - any suggestion as to how I could set the stop loss to be not more than 1.4 times of the take profit? The only other way that I can think of is to have a while loop set to on under ontick for every bar and then if the stop is bad, set it to off so it exits the EA
When the supplied inputs, are invalid according to your criteria or need, use the "INIT_PARAMETERS_INCORRECT" return code instead of "INIT_FAILED".
When the supplied inputs, are invalid according to your criteria or need, use the "INIT_PARAMETERS_INCORRECT" return code instead of "INIT_FAILED".
Thanks for this - I have a number of criteria in if-else statements within OnInit and I changed this to " INIT_PARAMETERS_INCORRECT" . The strategy then just cuts out after about 1 min, where I only see one result. Any ideas?
Please explain in more details and show some screenshots.
Also, remember that if you are setting your inputs wildly without any concern for the inputs that you wish, then most of the passes will fail and the final optimisations will be very few.
Also make sure that you enable to view ALL results without filters so that you can see them even if they are not of interest to you.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I would like to control the optimizer/strategy tester so it does not generate insane/crazy stop loss to take profit variations for when i select these for optimization (eg. stop loss of 100 and a take profit of 500). This is the code below that I have now in OnInit - any ideas? The optimization sometimes cuts out and does not even complete 1 min of testing with such code
Thanks.