Indicator buffers / DataWindow access

 

Hi,


I found one very nice indicator on the Internet. However I have no .mq4 sources of it, so I don't know exectly how it calculates the data...

I want to write EA, which will trade according to this indicator. How can I access the data of the indicator from source code of my AE?


To answer my question I was first trying to write some indicator on my own. I found out that the indicator data are hold in buffers. These buffers are defined in the following way:


#property  indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Silver

double buffer1[];

int init()
{
//...
SetIndexBuffer(0,ind_buffer1);
//...
}


How can I access indicator buffers from EA source?

It would be also sufficient for me to access values from DataWindow, becuse I noticed that the indicator is showing the values I need in this DataWindow.


Many thanks,

Miso

 

yes, buffers can be used by indicator as well as external inputs.

you must know the correct ordering of above items - as ordered in the indicator.

why? read this link and more will be understood https://book.mql4.com/samples/shared

 

Thank you. I resolved my problem ;-)