hi,
actually it's quite simple, do anyone know how to stop the rest of EA code if one condition is fullfilled?
since i'm still very new to this mql4 programming, any input would be appreciated.
for example :
if (condition 1)
ticket=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);
(here put the code to exit EA, so the EA only work until this part if condition 1 is fullfiled, the EA don't continue to check condition 2 anymore)
else
ticket=OrderSend(Symbol(),OP_SELL,0.1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);
if (condition 2)
ticket=OrderSend(Symbol(),OP_BUYLIMIT,0.1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);
else
ticket=OrderSend(Symbol(),OP_SELLLIMIT,0.1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);
actually it's quite simple, do anyone know how to stop the rest of EA code if one condition is fullfilled?
since i'm still very new to this mql4 programming, any input would be appreciated.
for example :
if (condition 1)
ticket=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);
(here put the code to exit EA, so the EA only work until this part if condition 1 is fullfiled, the EA don't continue to check condition 2 anymore)
else
ticket=OrderSend(Symbol(),OP_SELL,0.1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);
if (condition 2)
ticket=OrderSend(Symbol(),OP_BUYLIMIT,0.1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);
else
ticket=OrderSend(Symbol(),OP_SELLLIMIT,0.1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);