Download MetaTrader 5

memory problem

To add comments, please log in or register
Are you a real pro? Share your knowledge with millions of traders!
matse
83
matse 2010.08.10 19:16 
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
Alexey Da
Moderator
6612
Alexey Da 2010.08.11 12:00  

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. 

matse
83
matse 2010.08.11 16:42  
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.
To add comments, please log in or register