memory problem

 
I have the following problem. If I run a custom indicator in an expert by IndicatorCreate then it needs about 150-250MB of memory. Is there any way in the expert or in the indicator to limit the memory usage or the size of the price- / buffer-arrays?
Step on New Rails: Custom Indicators in MQL5
  • 2009.11.23
  • Андрей
  • www.mql5.com
I will not list all of the new possibilities and features of the new terminal and language. They are numerous, and some novelties are worth the discussion in a separate article. Also there is no code here, written with object-oriented programming, it is a too serous topic to be simply mentioned in a context as additional advantages for developers. In this article we will consider the indicators, their structure, drawing, types and their programming details, as compared to MQL4. I hope that this article will be useful both for beginners and experienced developers, maybe some of them will find something new.
Files:
ectest.mq5  3 kb
itest.mq5  3 kb
 

How many bars on chart do you have (press Ctrl+O, then go to tab Charts to see this setting)?

Memory usage depends on count of bars on the chart. 

 
Thank you, that solves the problem a little bit, had previously 1,000,000 and now 5000 Bars (smallest adjustable size).
Now two thirds less are used RAM.
Nevertheless, it should give a option to limit it in the indicator, as required only 50 bars. This could be save much Ram especially when many indicators are used in the Expert.
Reason: