Would you like you JForex Strategy to Email you when trades are closed (or when any other condition is reached)?
It is easy to implement, you just have to use the following in your onMessage code:
if (String.valueOf(message).contains("ORDER_CLOSE_OK")) {
sendEMail("Order Closed", String.valueOf(message));

where you have declared the following :
public String emailAddress="YourEmail@YourEmail.com";
public long lastSENDtime=0;

public void sendEMail(String subject, String content) throws JFException {
long thisSENDtime = System.currentTimeMillis();
if (thisSENDtime-lastSENDtime > 1000) {
context.getUtils().sendMail (emailAddress, subject, content);
}
lastSENDtime = thisSENDtime;
}

Note you can not send more than one Email per second, hence the time since last send check.
Traduire en Anglais Montrez l'original