Download MetaTrader 5

EMA Cross EA how to add distance between cross?

To add comments, please log in or register
fulltilt
384
fulltilt  
double MA1 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, 0);
double MA2 = iMA(NULL, 0, 15, 0, MODE_EMA, PRICE_CLOSE, 0);

if (MA1 > MA2 && ....)
{
Buy=true;
}


how can I add a min. distance fex. in points after the cross and what would be the best way?

signal should be triggered only if the distance between the lines is sufficient


ema

whroeder1
15577
whroeder1  
fulltilt: how can I add a min. distance fex. in points after the cross and what would be the best way?
if (MA1 > MA2 && ....)
if (MA1 > MA2 + MinDistance * pips2dbl)
To add comments, please log in or register