how put one order if have signal - page 3

 
RaptorUK:
How do you know when the signal has gone ?

??
 
RaptorUK:
?


when EMA 14 cut EMA 100. i will order one command.
 
phipho:

when EMA 14 cut EMA 100. i will order one command.

So when your signal is set place your trade and toggle a flag . . . 

SignalSet = true;

 but only place the trade

if(SignalSet == false)

// or 

if(!SignalSet)

 So now your SignalSet flag will be true and you won't have any more trades placed for the same signal . . .  

When you have detected that your signal has gone  . . .

SignalSet = false;

  . . . and next time you have a signal to place the trade you can . . .

 
RaptorUK:

So when your signal is set place your trade and toggle a flag . . . 

 but only place the trade

 So now your SignalSet flag will be true and you won't have any more trades placed for the same signal . . .  

When you have detected that your signal has gone  . . .

  . . . and next time you have a signal to place the trade you can . . .


now i must put this code where my EA
SignalSet = true
 
phipho:

now i must put this code where my EA
Think about it and figure it out . . .
 
phipho:
because i'm new guy learn write code mql4. I must learn write a easy EA. 

Do you know what moving average is ?.

If you do what I said, you will be able to answer RaptorUK's question "How do you know when the signal has gone ?" and you won't have many orders on every bars.

Reason: