Optimizer getting slower and slower

 

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?

 
😥
 
Eugen Funk:

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.

https://www.mql5.com/en/forum/459941

Optimization of Optimization and Backtest
Optimization of Optimization and Backtest
  • 2024.01.04
  • www.mql5.com
As I see(please correct me if I am wrong), when a back test starts speed is very high and passing time and increasing positions/orders and all oper...
 
Mahdi Ebrahimzadeh #:

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.

https://www.mql5.com/en/forum/459941

For me, when running optimization, the estimated time is quite accurate. Have you tried freeing resources as well as dynamically allocated memory in OnDeinit()?

 
Le Minh Duc #:

For me, when running optimization, the estimated time is quite accurate. Have you tried freeing resources as well as dynamically allocated memory in OnDeinit()?

actually no,

resources means indicators, arrays, structs, ..?

 
Le Minh Duc #:

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?

 
Eugen Funk #:

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()?


 
Mahdi Ebrahimzadeh #:

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 :)

 
Mahdi Ebrahimzadeh #:

actually no,

resources means indicators, arrays, structs, ..?

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
  • www.mql5.com
ResourceFree - Common Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

Thank you!

Is there a way to see (profiler?) if all memoery if free after calling onDeinit? 🤔 This would give me confidence instead of searching all the code and guessing where I might have forgotten something.