MetaTrader 4 - Trade when the EMA 10 touches the EMA 20?

 

Hello guys,

I am not a noob in programming, however, I am new metatrader.

I want to create a simple ea. I want to trade when the EMA 10 touches the EMA 20.

Please give me an overview how to model this touch in the metatrader language.


Thx in advance!!!

 
pisco:

Hello guys,

I am not a noob in programming, however, I am new metatrader.

I want to create a simple ea. I want to trade when the EMA 10 touches the EMA 20.

Please give me an overview how to model this touch in the metatrader language.

Check when iMA() == iMA()  bearing in mind double comparison issues.

It's not quite that simple though,  the EMAs may cross ( a cross is also a touch ? ) between bars so you would also need to check the previous bars values compared to the bar you are interested in.

 
Or check when they cross
 
pisco:

Hello guys,

I am not a noob in programming, however, I am new metatrader.

I want to create a simple ea. I want to trade when the EMA 10 touches the EMA 20.

Please give me an overview how to model this touch in the metatrader language.


Thx in advance!!!


Are you a noob in searching too ?