Download MetaTrader 5

Maximum number of indicator buffers?

To add comments, please log in or register
Do you wonder how to use widgets? Read the article!
Tony
260
Tony 2010.02.26 22:58 

Hi

I thought I had read that the maximum umber of indicator buffers had changed in MQL5, but I can't find what I thought I read. Would someone please clarify what the maximum number of indicator buffers is?

Thanks

Jellybean

Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Indicators Lines
  • www.mql5.com
Standard Constants, Enumerations and Structures / Indicator Constants / Indicators Lines - Documentation on MQL5
Rashid Umarov
Admin
11836
Rashid Umarov 2010.02.26 23:14  

See Technical indicators:

Custom Indicators can contain up to 512 indicator buffers, and the buffer data also can be obtained by using the CopyBuffer() function, with the handle returned by function iCustom().



Tony
260
Tony 2010.02.27 03:47  

Thank you Rosh.

I did search, but I missed this.

Jellybean

Loong
1261
Loong 2010.03.09 10:22  
Jin:

Hi Rosh,

I built an custom indicator using 11 indicator buffers, but I just plot 2 (I mean, I'm using 2 buffers of type INDICATOR_DATA, 2 of type INDICATOR_COLOR_INDEX, and 7 of type INDICATOR_CALCULATIONS).

The problem is that I can just access 5 of my buffers, using CopyBuffer() function, the others 6 comes as arrays of zeroes.

It seems that besides the indicators of type INDICATOR_DATA and INDICATOR_COLOR_INDEX, I can just access one buffer of type INDICATOR_CALCULATIONS.

To work-around this, I had to have another version of my indicator, with all my buffers changed to the type INDICATOR_DATA, just to be able to access by CopyBuffer().

Is this a limitation of MQL5, or I am doing something wrong? Please, help me.

Thanks.

 

 

 

 

 

 

arrangement
Jin
1539
Jin 2010.03.11 05:44  
Rosh:

See Technical indicators:



Rosh,

Even though a Custom Indicator can have up to 512 buffers, you cannot access all of them. It seems that you can access with CopyBuffer() only buffers of types INDICATOR_DATA and INDICATOR_COLOR_INDEX, plus just one buffer of type INDICATOR_CALCULATIONS.

To show this, I create a dummy indicator with 6 buffers: 2 INDICATOR_DATA, 1 INDICATOR_COLOR_INDEX, and 3 INDICATOR_CALCULATIONS. The CopyBuffer() could only access the first 4 buffers (only one of the three INDICATOR_CALCULATIONS could be returned by CopyBuffers).

To work-around this, you have to create another version of this indicator, with all my buffers of type INDICATOR_CALCULATIONS changed to the type INDICATOR_DATA, just to be able to access by CopyBuffer().

As I said, it's a word-around, not a desired solution to this limitation. It's very annoying to have to have always 2 versions of the same indicator just to be able to access all this buffers.

Please, help.

(I attach the dummy indicator and the dummy indicator reader)

Rashid Umarov
Admin
11836
Rashid Umarov 2010.03.11 07:02  
Thank you. We will check it.

Rashid Umarov
Admin
11836
Rashid Umarov 2010.03.12 11:47  
Rosh:
Thank you. We will check it.

Done, wait for updates, please.

To add comments, please log in or register