Download MetaTrader 5

Maximum number of indicator buffers?

To add comments, please log in or register
Tony
264
Tony  

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
12700
Rashid Umarov  

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
264
Tony  

Thank you Rosh.

I did search, but I missed this.

Jellybean

Loong
1318
Loong  
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
1540
Jin  
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
12700
Rashid Umarov  
Thank you. We will check it.

Rashid Umarov
Admin
12700
Rashid Umarov  
Rosh:
Thank you. We will check it.

Done, wait for updates, please.

gary0318
11
gary0318  
Rashid Umarov:
Done, wait for updates, please.

Wow. This dates back to 2010. I could use the info too. Can someone shed light on this?


Thanks,

Gary

Jose Francisco Casado Fernandez
4061
Jose Francisco Casado Fernandez  
gary0318:

Wow. This dates back to 2010. I could use the info too. Can someone shed light on this?


Thanks,

Gary

Currently there is no problem. Tested.  You can see the image about dummy_indicator :



Regards.

To add comments, please log in or register