Discussing the article: "A Generic Optimization Formulation (GOF) to Implement Custom Max with Constraints"
First of all, thank you very much for writing such an important and interesting mql5 article and corresponding mql5 library, which definitely it is much more than appreciated. If it were possible for you I would be enormously grateful to you if you could please let me know or even better implement two small improvement o changes to your existing Generic Optimization Formulation (GOF) mql5 library. The first one would be: how to include as a new objective function the Equity Drawdown relative in percentage in your GOF mql5 mqh library to be MINIMIZED along with other potential Objective functions which may be MAXIMIZED in a combined overall Objective function with an overall 2 or more performance metrics ?. And last but not least, if it were feasible and possible as second request would be the following: although the targets you have already defined can be employed to emulate some sort or “normalized” objective function, Would it be possible to really get the correct normalization of the individual Xi values (i.e the Z transformation)? by subtracting the average of the sample we may have computed in advance to each individual Xi value and dividing the previous individual result by standard deviation of the sample for this particular performance metric which of course we would need to provide for each performance metric as inputs in the Generic Optimization Formulation mql5 library (i.e. the average and the standard deviation of the computed sample for each individual objective function we would like to employ). Once again thank you in advance for your prompt feedback and support.

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
Check out the new article: A Generic Optimization Formulation (GOF) to Implement Custom Max with Constraints.
In this article we will present a way to implement optimization problems with multiple objectives and constraints when selecting "Custom Max" in the Setting tab of the MetaTrader 5 terminal. As an example, the optimization problem could be: Maximize Profit Factor, Net
Profit, and Recovery Factor, such that the Draw Down is less than 10%, the number of consecutive losses is less than 5, and the number of trades per week is more than 5.
In general terms, there are two main types of optimization algorithms. The first type is the more classical, based on the calculation of gradients of all functions involved in the optimization problem (this dates back to Isaac Newton’s times). The second type is more recent (since the ~1970’s) that does not use gradient information at all. In between, there may be algorithms that combine the two approaches mentioned, but we don’t need to address them here. The MetaTrader 5 algorithm called “Fast Genetic based Algorithm”---in the MetaTrader 5 terminal Settings tab---belongs to the second type. This allows us to skip the need for the computation gradients for objective and constraint functions. Even more, thanks to the gradient-less nature of the MetaTrader 5 algorithm, we were able to account for constraints functions that would not had been appropriate with gradient-based algorithms. More on this will be discussed below.
One important point is that the MetaTrader 5 algorithm called “Slow Complete Algorithm” is not actually an optimization algorithm but a brute force, exhaustive evaluation of all possible combinations of values for all the input variables within the side constraints.
Author: better.trader every.day