how to put 2 indicators together in ea

 

rule is simple

  • buy when 10 ema > 50 ema and 20 wma > 40 wma
  • sell 10 ema < 50 ema and 20 wma < 40 wma

i tryed both ways but they give me no trades and no errors, i dont know is that format is right or not

//-------------------------------------------------------

if (10 ema > 50 ema && 20 wma > 40 wma)

{ enter buy}

if (10 ema < 50 ema && 20 wma < 40 wma)

{enter sell)

//----------------------------------------------------------

or

//---------------------------------------------------------

if (10 ema > 50 ema)

{ if (20 wma > 40 wma)

{enter buy}

if (10 ema < 50 ema)

{if 20 wma < 40 wma)

{enter sell}

//-----------------------------------------------------------


 

dotzoo

Need to see the rest of the code to see how you are getting the values to compare - what you summarise should work...

FWIW

-BB-

Reason: