EMA with alert

 

Hi all,

new to MQL4.

I would like to build a simple 50 EMA that send out an email to me when price closed below or above it.

Can anyone can give me some codes to start with?

Thank in advance.

 
dcmb:

Hi all,

new to MQL4.

I would like to build a simple 50 EMA that send out an email to me when price closed below or above it.

Can anyone can give me some codes to start with?

Thank in advance.

Use macd with alerts and set the fast ema period to 1 and slow period to ema period that you want to use: that will be exactly the same as what you are looking for
 
Mladen Rakic:
Use macd with alerts and set the fast ema period to 1 and slow period to ema period that you want to use: that will be exactly the same as what you are looking for

Thank you Mladen. Did you mean just use the MACD indicator directly instead of using MQL4 to code?

 
dcmb:

Thank you Mladen. Did you mean just use the MACD indicator directly instead of using MQL4 to code?

Anyway I just tried to play around withthe MACD indicator in MT4 directly. There's no option for me to set any alert.
 
dcmb:
Anyway I just tried to play around withthe MACD indicator in MT4 directly. There's no option for me to set any alert.
dcmb:

Thank you Mladen. Did you mean just use the MACD indicator directly instead of using MQL4 to code?

What I meant is that instead of using some ema indicator written for that purpose, you can use some existing macd with alerts (and there are a lot of existing custom macd indicators with alerts on zero cross)
 
Mladen Rakic:

What I meant is that instead of using some ema indicator written for that purpose, you can use some existing macd with alerts (and there are a lot of existing custom macd indicators with alerts on zero cross)

Mladen Rakic:
What I meant is that instead of using some ema indicator written for that purpose, you can use some existing macd with alerts (and there are a lot of existing custom macd indicators with alerts on zero cross)

Ok. I will google for that and try to learn from the codes :)

thank you.

 
Mladen Rakic:
Use macd with alerts and set the fast ema period to 1 and slow period to ema period that you want to use: that will be exactly the same as what you are looking for

This do not work as espected Mladen... I set fast EMA to 1 and slow to 200 and can not see the cross of them at the price touching 200... 

 
jagorz:

This do not work as espected Mladen... I set fast EMA to 1 and slow to 200 and can not see the cross of them at the price touching 200... 

Try this one.

 
please how can i add alart to my custom indicator ?
Reason: