Is there a way to automate emails when trade is closed?

 

Hi Guys,

I'm looking for an EA or an Indicator that will send mail when a trade is closed with details such as the pair, P/L. I've been looking around for this but couldn't find anything. As of now, I use the MT4 ftp publisher which I access via the browser to check every hour. The MT4 default alert system for Bid/Ask price is kind of tedious when there are more open trades.

Would be nice if an email would be sent everytime a trade was closed.

Thanks.

 
jb1981:

Hi Guys,

I'm looking for an EA or an Indicator that will send mail when a trade is closed with details such as the pair, P/L. I've been looking around for this but couldn't find anything. As of now, I use the MT4 ftp publisher which I access via the browser to check every hour. The MT4 default alert system for Bid/Ask price is kind of tedious when there are more open trades.

Would be nice if an email would be sent everytime a trade was closed.

It's pretty easy to do, depending on how elegant you want it to be,  rough and ready version:  check OrderHistoryTotal() when it increases find the last added order to the History and use SendMail()  with OrderPrint()  don't forget to select the correct order first using OrderSelect()
 
Thanks. Will give it a go and see how it turns out.
Reason: