Dear Friends, I added the "Custom max" to the mql5 code for best optimizing. Custom Optimizing condition: Profit^2 * Trade Number * 1/minimum dd perhaps it could be further developed is on line 3200 that I added