How can I release Indicator memory (RAM)? - page 3

To add comments, please log in or register
Sharon Aharonov
222
Sharon Aharonov  
So someone, any solution? 
Marco vd Heijden
Moderator
12406
Marco vd Heijden  
The answer has been given.
Sharon Aharonov
222
Sharon Aharonov  
Marco vd Heijden:
The answer has been given.

Sorry but how exactly? 

Icham Aidibe
11549
Icham Aidibe  

I've also met those kind of ram weakness, but in my case it was about calculation on about 30 pairs - I've found a way thru, so obviously there's a solution to your problem. A fact being we don't know what your routine looks like. 

Just in case here's some track you could look for : 

  • Perform calculation each new bar or each x (to define) minutes rather than on each tick 
  • An array even huge used to saved some data won't break your ram then you could free it as soon as the information is displayed on screen 
  • In your code, use the array only to stock the result of the calculation, and not to calculate from
  • etc etc ... 
Hope it helps.
Revo Trades
104
Revo Trades  

While I believe that i can see your problem: eg ArrayResize, AND I agree with your assumption that it is the issue, AND I think it is obvious that you need to recode it so that you either do not use it, OR you devide your tool into more than 1 indicator or ea; I am 100% with Mladen: if you can not or will not post the code, everything we suggest can only be guesswork, and most probable that most of our suggestions will have nothing to do with the issue. I am also assuming this from your responses that this has already occured a few times. If you can not post the code in SRC, then, at least attach it as a file.

I am sure that you may have issue with posting your code either way, but if you want special assistance, as your problem obviously requires, then, you need to post your code, OR pay someone and sign a NDD with that coder.

By "recoding" I did mean like Icham has suggested in his post: Use arrays to store the result only.

William Roeder
19188
William Roeder  
Sharon Aharonov: All my bars are calculations are limited, this is not the problem.

To reduce CPU, you can limit the bars calculated. Or reduce Max bars in chart to something reasonable like 1K. Or, as a last resort, use my segmented OnCalculate include file.
          Your indicator is too slow... - Indices - MQL4 programming forum #1 № 6

All buffers are sized to the number of bars on the chart. Reduce reduce Tools → Options (control-O) → Charts → Max bars in chart to something reasonable (like 1K.)

Using arrays verses buffers will make no difference to RAM, unless your arrays are only accessed circularly, thus limiting them to small sizes.

Sharon Aharonov
222
Sharon Aharonov  
Icham Aidibe:

I've also met those kind of ram weakness, but in my case it was about calculation on about 30 pairs - I've found a way thru, so obviously there's a solution to your problem. A fact being we don't know what your routine looks like. 

Just in case here's some track you could look for : 

  • Perform calculation each new bar or each x (to define) minutes rather than on each tick 
  • An array even huge used to saved some data won't break your ram then you could free it as soon as the information is displayed on screen 
  • In your code, use the array only to stock the result of the calculation, and not to calculate from
  • etc etc ... 
Hope it helps.

Yes it seems that there is no escape. I don't know why the ArrayFree or ArrayResize doesn't free the memory, so as you said, I need to get throgh the code and trying to optimze it. Thanks..

Sharon Aharonov
222
Sharon Aharonov  
Revo Trades:

While I believe that i can see your problem: eg ArrayResize, AND I agree with your assumption that it is the issue, AND I think it is obvious that you need to recode it so that you either do not use it, OR you devide your tool into more than 1 indicator or ea; I am 100% with Mladen: if you can not or will not post the code, everything we suggest can only be guesswork, and most probable that most of our suggestions will have nothing to do with the issue. I am also assuming this from your responses that this has already occured a few times. If you can not post the code in SRC, then, at least attach it as a file.

I am sure that you may have issue with posting your code either way, but if you want special assistance, as your problem obviously requires, then, you need to post your code, OR pay someone and sign a NDD with that coder.

By "recoding" I did mean like Icham has suggested in his post: Use arrays to store the result only.

I will try to write a short example code that can display the problem (I need some time for that..)

Sharon Aharonov
222
Sharon Aharonov  
William Roeder:

To reduce CPU, you can limit the bars calculated. Or reduce Max bars in chart to something reasonable like 1K. Or, as a last resort, use my segmented OnCalculate include file.
          Your indicator is too slow... - Indices - MQL4 programming forum #1 № 6

All buffers are sized to the number of bars on the chart. Reduce reduce Tools → Options (control-O) → Charts → Max bars in chart to something reasonable (like 1K.)

Using arrays verses buffers will make no difference to RAM, unless your arrays are only accessed circularly, thus limiting them to small sizes.

Will try. Thanks..

123
To add comments, please log in or register