Problem sending trade close confirmation email New comment Timothy Smith 2017.11.10 04:56 Hi MQL community,When my EA closes a trade I want it to send me an email confirming if it was a winning or losing trade.My problem is that it keeps sending multiple emails. I'm not sure if it's a problem with my code or a broader technical issue aswhen I send the generic email "test", I sometimes receive multiple copies also. Can someone please help!Please see journal entries and code below: if(OrderSelect(OrderTicket(),SELECT_BY_TICKET,MODE_HISTORY)==true) if( OrderMagicNumber() == MagicNumber) if(OrderType()==OP_SELL) if (OrderClosePrice()>=OrderTakeProfit()) SendMail("winner","winner"); else (GetLastError()); if (OrderClosePrice()<=OrderStopLoss()) SendMail("loser","loser"); else (GetLastError());Regards, Tim order closed by system? Email Please help. MQL5 EA sendmail function sends me repeat emails on every tick, how to make it send me an email only once per closed deal? Carl Schreiber 2017.11.10 10:07 #1 Use OrderCloseTime() and check whether it is greater than the time of your last email. New comment
Hi MQL community,
When my EA closes a trade I want it to send me an email confirming if it was a winning or losing trade.
My problem is that it keeps sending multiple emails. I'm not sure if it's a problem with my code or a broader technical issue as
when I send the generic email "test", I sometimes receive multiple copies also. Can someone please help!
Please see journal entries and code below:
Regards, Tim