MQL5 - How to handle Custom indicator to different buffers of iEnvelopes (and others)

Hi everyone,
Here’s the problem:

I get buffers from example indicator multiple buffers like iEnvelopes correctly through numbering in CopyBuffer

handle1 = iEnvelopes (NULL, 0, period, 0, method, price, deviation);
       CopyBuffer (handle1, buffer = 0,0,3, arrayUpper)> 0)
       CopyBuffer (handle1, buffer = 1,0,3, arrayLower)> 0)

but if I hook an indicator with

handle2 = iCustom (NULL, 0, "..... indicator2", period2, ........, 0, handle1);
       (CopyBuffer (handle2, buffer = 0,0,3, array2upper)> 0)
       (CopyBuffer (handle2, buffer = 1,0,3, array3lower)> 0)

how can i get handle2’s extracted on two different buffers of handle1-iEnvelopes ???
it seems that handle2 (indicator attached to the Envelopes) has only one buffer and therefore returns all zero values

i need to extract two different buffers on Envelopes (Upper and Lower)
I hope I have explained well
thanks in advance for any help

1 Like