To code it, you should be measuring the Drawdown inside the ontick function... and if it reaches your max, then you can use ExpertRemove()... this will stop the current backtest run ad take the optimizer to the next run... optionally, before using expert remove, check that you are in a testing enviroment, rather than a production enviroment, to prevent EAremoval on production enviroment.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Dear all,
In MT4 we were able to hard set for example a max of 10% equity DD for the optimization process.
In MT5 they do not have a direct feature for this so I was figuring out how to code it.
Right now I have been using the following code but getting an error.
"Genetic pass 0,506) tested with error " incorrect input parameters" in 0:00:00.000"
Once the INIT PARAMETERS INCORRECT has been triggered the entire optimization directly stops in the first 5 seconds.
Why does the optimization not continue? Is there a way so I can set as an input the max drawdown I would like to realize?
Help is greatly appreciated <3