Hi, I observe the optimizer in MT5 getting slower and slower over time. At first, it shows to need 20 hours for 10000 runs. After 2000 runs it shows 600hrs .
Quite often, when all agents are done, the optimizer waits and waits before it starts the next iteration.
Is there anything I can check in order to make it work faster?
for sure you can make your code to work faster, but issue is there and time increases in a polynomial manner.
I asked for but nothing to do more.
![Optimization of Optimization and Backtest Optimization of Optimization and Backtest](https://c.mql5.com/36/82/optimization-of-optimization-and.jpg)
- 2024.01.04
- www.mql5.com
for sure you can make your code to work faster, but issue is there and time increases in a polynomial manner.
I asked for but nothing to do more.
For me, when running optimization, the estimated time is quite accurate. Have you tried freeing resources as well as dynamically allocated memory in OnDeinit()?
For me, when running optimization, the estimated time is quite accurate. Have you tried freeing resources as well as dynamically allocated memory in OnDeinit()?
Thank you. Yes, but I am not sure if I free ALL ressources.
I currently assume, that if there is not log message about a memory leak, then all ressources are cleared?
Is there a way to verify that?
I currently assume, that if there is not log message about a memory leak, then all ressources are cleared?
Honestly, I do not know if we need to release memories end of each opt steps or they will automatically!?
based on what Le Minh said, if we release dynamic resources in OnDeinit function, there will not be any accumulation of source! Or at least I understand this from his response. I am waiting for his re-response to my next question.
Forum on trading, automated trading systems and testing trading strategies
Optimizer getting slower and slower
Le Minh Duc, 2024.01.28 04:13
For me, when running optimization, the estimated time is quite accurate. Have you tried freeing resources as well as dynamically allocated memory in OnDeinit()?
Honestly, I do not know if we need to release memories end of each opt steps or they will automatically!?
based on what Le Minh said, if we release dynamic resources in OnDeinit function, there will not be any accumulation of source! Or at least I understand this from his response. I am waiting for his re-response to my next question.
Yes I tried :)
For resources that you use the ...Create() method, you should release them. For example, IndicatorCreate(), ResourceCreate()... When you don't use them anymore, use functions like IndicatorRelease(), ResourceFree(). Or dynamically allocated Arrays using the ArrayResize() method, when you don't use it . Instances are initialized with the keyword "new" and pointers can be released with "delete".
You can refer more here: https://www.mql5.com/en/docs/basis/variables/object_live
![Documentation on MQL5: Common Functions / ResourceFree Documentation on MQL5: Common Functions / ResourceFree](https://c.mql5.com/36/82/documentation-on-mql5-common-functions.png)
- www.mql5.com
![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 observe the optimizer in MT5 getting slower and slower over time. At first, it shows to need 20 hours for 10000 runs. After 2000 runs it shows 600hrs .
Quite often, when all agents are done, the optimizer waits and waits before it starts the next iteration.
Is there anything I can check in order to make it work faster?