Getting information from indicators inti EA

 

Hi all

I'm trying to find out how I can import information from indicators to my EA.  I can see in the examples that comes with the MT4 environment that I've downloaded how I can access data from the standard MACD indicator, but I'm currently looking at two other indicators that I'd like to use.  One is a standard one, and the other is an indicator that I found (I think, I found it in this forum, but I don't know who is responsible for it).  My question is if I can somehow see the interface that I should use to communicate with this indicator from an EA, and where I can see what information I get back (and in which variables)?

Best regards
G. 

 

Hello G.,

Maybe you could consider adding some code to SRC or attaching indicators you speak of. You'd get better support by coders here, cuz we'd all know what your talkin' bout, pro :)


My question is if I can somehow see the interface that I should use to communicate with this indicator from an EA, and where I can see what information I get back (and in which variables)?

RE: when you write code like-

if(iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)>iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0)) return(0);

to an EA, you'll see the MACD indicator operating in a chart if ya run the EA in visual mode when testing with the tester.


Thank you

 

Hi

Thanks for your reply.

Unfortunably, I'm not able to give you an examples of my code, because I'm trying to find out how to code the interface between my EA and the relevant indicator programs, and therefore, I don't yet have anything to show.  So what I'm hoping to find is some kind of documentation about how to do this, i.e. how my program can talk to the relevant indicator, and where I find the information that the indicator sends back to my program.

You mention a 'tester' that can be used to test the EA.  I'm pretty new in this field, and I haven't really heard about any real tester in this area, so I'm kind of testing it on a demo account.  It is very time consuming, and if you also could give me some more information about this tester, I'd appreciate it a lot.  The only tester that I've heard about until now is the backtest in MT4, and I've found it very unprecise, but it would be really nice to have a real testing environment to be able to test new EAs'.

Many thanks in advance.

Best regards

 
gjon:

Hi all

I'm trying to find out how I can import information from indicators to my EA.  I can see in the examples that comes with the MT4 environment that I've downloaded how I can access data from the standard MACD indicator, but I'm currently looking at two other indicators that I'd like to use.  One is a standard one, and the other is an indicator that I found (I think, I found it in this forum, but I don't know who is responsible for it).  My question is if I can somehow see the interface that I should use to communicate with this indicator from an EA, and where I can see what information I get back (and in which variables)?

Best regards
G. 


Hi gjon,

There are 2 kinds of indicators you can use in mq4:

1- Built-in indicators.

2- Custom (Programmere-made) indicators.

For the built-in indicators you will use the appropriate indicatir function (example: iMA, iMACD, iRSI and etc).

For the custom made indicators use iCustom function.

 

Hi WhooDoo22 and codersguru

Thank you for your input.  I think, I now understand how it works, and that I will be able to find more information from keywords found in your replies.

Best regards