How to access data arrays of a custom indicator from inside the EA?

To add comments, please log in or register
Shui Wang
170
Shui Wang  

Hello all,

I want to access data arrays of my custom indicator and write these data to a file for analysis.

The data array in the custom indicator is like:

//--- indicator buffers
double         profit[];

and within my EA, I want to get values of profit[] as well as its size ( ie. ArraySize(profit)  ).

Any help is sincerely appreciated.  :)

Georgiy Liashchenko
4333
Georgiy Liashchenko  
Shui Wang:

Hello all,

I want to access data arrays of my custom indicator and write these data to a file for analysis.

The data array in the custom indicator is like:

and within my EA, I want to get values of profit[] as well as its size ( ie. ArraySize(profit)  ).

Any help is sincerely appreciated.  :)


Just add required array to output buffers and retrieve this data as other data from indicators
Shui Wang
170
Shui Wang  
Georgiy Liashchenko:

Just add required array to output buffers and retrieve this data as other data from indicators


Thanks for you kindly reply!

Although I'm not sure if I get your idea correctly, but I think you meant it should be done like this:

1. SetIndexBuffer() to set the array as an index buffer

2. SetIndexStyle() as DRAW_NONE

3.access its value with iCustom

the catch is: I don't know the array size, and I can't determine the start & end point of the data series that will be saved to file.

Georgiy Liashchenko
4333
Georgiy Liashchenko  
Shui Wang:


Thanks for you kindly reply!

Although I'm not sure if I get your idea correctly, but I think you meant it should be done like this:

1. SetIndexBuffer() to set the array as an index buffer

2. SetIndexStyle() as DRAW_NONE

3.access its value with iCustom

the catch is: I don't know the array size, and I can't determine the start & end point of the data series that will be saved to file.

Exactly. Array cannot go above total bars. Use this as a start point for calculation
To add comments, please log in or register