if statment when position close

 

Hello all,


I want to send emails - if position close I want to send what is the profit and if the position open I want to send what is the takeprofit and stoploss


What I need to write on the if statment?


Thanks

 

It isn't just an if statement.

  1. Remember the ticket number when you open, and send your TP/SL email. No if required.
  2. Select the ticket each tick and wait for the order to close, (If OrderCloseTime is not zero,) send your profit email, and clear the ticket number.
 
William Roeder:

It isn't just an if statement.

  1. Remember the ticket number when you open, and send your TP/SL email. No if required.
  2. Select the ticket each tick and wait for the order to close, (If OrderCloseTime is not zero,) send your profit email, and clear the ticket number.

I'm not pro programmer,

So I need a code example.

Thanks.

 
LiorB: I'm not pro programmer, So I need a code example.
MT4: Learn to code it.
MT5: Learn to code. If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into yours.

Show us your attempt (using the CODE button) and state the nature of your problem.
          No free help
          urgent help.
Reason: