Download MetaTrader 5

How to release memory use by build-in indicators?

To add comments, please log in or register
Thousands of developers have already published their products in the Market. Join them!
Roel
485
Roel 2015.02.19 05:45 

How can I release the memory previously used by iRSI, iStochastic etc.?

I run into memory issues when using iStochastic for 1 million bars with various settings. I think that if it was somehow possible to clean up MT4's internal memory use it would be better.

Rodrigo Malacarne
Moderator
9904
Rodrigo Malacarne 2015.02.19 11:34  
Roel13:

How can I release the memory previously used by iRSI, iStochastic etc.?

I run into memory issues when using iStochastic for 1 million bars with various settings. I think that if it was somehow possible to clean up MT4's internal memory use it would be better.

Hello Roel13,

May I ask you why you need 1 million bars? Try to decrease the amount of bars used in your calculations. In order to do that, please take a look here: http://www.metatrader5.com/en/terminal/help/settings/settings_charts

Regards,
Malacarne

Roel
485
Roel 2015.02.23 03:02  
Malacarne:

Hello Roel13,

May I ask you why you need 1 million bars? Try to decrease the amount of bars used in your calculations. In order to do that, please take a look here: http://www.metatrader5.com/en/terminal/help/settings/settings_charts

Regards,
Malacarne

Hello Malacarne,

To get a more reliable overview of how good a formula is.

Is there any way to clean up MT4's internal memory use it would be better?

This issue/bug is easy to similute btw, just run hundreds of calculations with varying settings on i<some internal indicator>; it seems clear that MT4 somehow caches the information for all of them and then runs out of memory.

Jose Francisco Casado Fernandez
2407
Jose Francisco Casado Fernandez 2015.02.24 03:39  

If you don't need that buffer(s) anymore, you can use:


void  ArrayFree(
   void&  array[]      // array
   );

https://www.mql5.com/en/docs/array/arrayfree


But if you want to keep indicator buffer(s)  working, rewrite the indicator to only calculate new bars not previously calculated.


A kind regard.

Documentation on MQL5: Array Functions / ArrayFree
Documentation on MQL5: Array Functions / ArrayFree
  • www.mql5.com
Array Functions / ArrayFree - Reference on algorithmic/automated trading language for MetaTrader 5
n22alpha
63
n22alpha 2015.02.24 21:07  

doesn't the delete function also work?

CiMA maMovingAverage = new CiMA

delete(maMovingAverage);  (In the deinit section of the code)

To add comments, please log in or register