Problems with optimization in Metatrader 5. " Genetic pass tested with error " "no Memory"

 

The error is in the image above.

2022.01.07 16:18:29.611 Core 12 genetic pass (0, 463) tested with error "no memory in OnTrade function (cannot get 54951 Kb, used 2640 Mb)" in 0:02:28.920


I am having numerous problems optimizing my Robots using Metatrader 5, this started after I tried to optimize using "each tick is based on a real tick".


I've already tried the following steps:

1. Optimized my robot's code, disabling texts displayed on the screen, putting calculations to run only when they're really needed, removing any useless code that wouldn't be used.

2. I'm optimizing a few parameters, a total of 5 parameters and I put it in large steps so that the backtest result doesn't take so long look at the image below:


3. I'm just optimizing for 1 month.

I observe in my researches here on the forum and all over the internet that MetaQuotes seems not to be giving so much importance to explaining why this problem, there are several errors that happen one different from the other when there is a need to try to optimize, there is a total disregard for part of them in trying to elucidate the truth about this problem and provide a possible solution that will be effective.


I started to believe that this problem is happening due to lack of information from MetaQuotes with Metatrader 5 users, I believe there is a relationship with Processing and Minimum Memory needed for a certain period of optimization and data consumption, and when it is reached issues errors warning that it is working at the limit.

On the other hand, I've read in some comments that older versions of Metatrader 5 didn't have this error, which leads to the understanding that MetaQuotes forces the update of Metatrader 5 on purpose for this problem to happen and for lack of a solution we are forced to hire services paid in the "cloud", is this perhaps the reason for so much negligence?

I would like to know what solutions exist for this, if you can please share it here with me or with us.

 

MT5 Strategy Tester is using a lot of resources, that's for sure.

If you get this error that's because at some points there is no more memory available. Firstly, you need to check you code for memory usage, check the available resources (memory, hard disk) when the optimization is running. Usually a solution is to disable some agents (cores).

But allocating more than 50Mb in OnTrade() seems weird to me, I bet the main issue is in your code.
Reason: