Copy data from an indicator into an array

 

Hi 

I have three question, but they are all related to the same issue.

I have an indicator that creates an array with some data, and I'd like to import all the data to my EA, i.e. not only for one candle, but the whole array, i.e. something like

Testing_iCustom = iCustom(NULL, 0, "ABCD", 2, 4, 8, 16, 24, 32, 60, 120, 200, 1, *); 

Do you know if this is possible? 

If not, do you then know, if I could easily add the code from the indicator to my EA?

If it is possible to easily add the code to the EA, do you then know where I can find information about this?

Thanks in advance.

Best regards

 
gjon:

Hi 

I have three question, but they are all related to the same issue.

I have an indicator that creates an array with some data, and I'd like to import all the data to my EA, i.e. not only for one candle, but the whole array, i.e. something like

Testing_iCustom = iCustom(NULL, 0, "ABCD", 2, 4, 8, 16, 24, 32, 60, 120, 200, 1, *); 

Just put the iCustom call in a loop as required.  You can transfer the calculation part of an Indicator into an EA,  to do much more than that means handling buffers in your own code and can be a little complicated.
 
gjon: not only for one candle, but the whole array, i.e. something like
Testing_iCustom = iCustom(NULL, 0, "ABCD", 2, 4, 8, 16, 24, 32, 60, 120, 200, 1, *);
Do you know if this is possible?
Do you really need the whole array?
#define MAX_ELEMENTS 999
double ABCDvalues[MAX_ELEMENTES];
for(int iVal = 0; iVal < MAX_ELEMENTS)
   ABCDvalues[iVal] = iCustom(NULL, 0, "ABCD", 2, 4, 8, 16, 24, 32, 60, 120, 200, 1, iVal); 
Or If you do
double ABCDvalues[];
ArrayResize(ABCDvalues, Bars);
for(int iVal = 0; iVal < Bars)
   ABCDvalues[iVal] = iCustom(NULL, 0, "ABCD", 2, 4, 8, 16, 24, 32, 60, 120, 200, 1, iVal); 
Reason: