MACD mt4 crossover into EA

 

Hi all!

I am new to MQL4 programming, and I have started to learn programming outside the MQL4 language. So my experience is very lacking.

Now I am trying to make my first EA that only gives at a alert when something is happening. I think it isn't a huge deal to change the alert to a buy, or sell  function. 

Let me explain:

I am trying to make a EA that gives out a signal when the price is under or above the 200EMA (just for trend confirmation).

When the price is above the 200 EMA and the MACD lines cross, then I need to get a signal to pop-up. With the standard iMACD I think there aren't two lines (signal and macd line), but just the histogram and the MACD line, as in the standard MACD comming with metatrader4.

Now my question is:

How do I make two doubles with the corresponding values of the signal line and the MACDline itself?

I hope that you can help with this problem, and give me a idea on how to tackle this problem!

Thanks in advance!

Yours sincerely,


Daan

Reason: