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: https://www.metatrader5.com/en/terminal/help/startworking/settings
Regards,
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: https://www.metatrader5.com/en/terminal/help/startworking/settings
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.
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.

- www.mql5.com
Hello guys.
My code eat all ram memory and can not release it.
When indicator ran, ram usage become 99% until i remove Indicator from chart.
This is my code:
//+------------------------------------------------------------------+ #property copyright "Copyright 2017, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property indicator_chart_window int fast_ema_Period=12; //Fast Period int slow_ema_Period=26; //Slow Period int signal_Period=9; //Signal Period //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { for (fast_ema_Period=1; fast_ema_Period <= 1000; fast_ema_Period++) { iMACD(Symbol(),0,fast_ema_Period,slow_ema_Period,signal_Period,PRICE_CLOSE); } //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { return(rates_total); } //+------------------------------------------------------------------+
IN THIS LINE :
iMACD(Symbol(),0,fast_ema_Period,slow_ema_Period,signal_Period,PRICE_CLOSE);
When iMACD Initialized, some Memory used.
"" IS THERE ANY WAY TO RELEASE RAM BEFORE OnCalculate FUNCTION HAS BEEN END ????????? ""

- www.mql5.com
Hello guys.
My code eat all ram memory and can not release it.
When indicator ran, ram usage become 99% until i remove Indicator from chart.
This is my code:
IN THIS LINE :
iMACD(Symbol(),0,fast_ema_Period,slow_ema_Period,signal_Period,PRICE_CLOSE);
When iMACD Initialized, some Memory used.
"" IS THERE ANY WAY TO RELEASE RAM BEFORE OnCalculate FUNCTION HAS BEEN END ????????? ""
For sure you have memory issue, you are opening 1000 indicators.
See IndicatorRelease(), but that will not help if you don't change your approach.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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.