1. place a limit order and check it was placed. this confirms the ea is working in connection with borker.
2. send HB to external plataform, may be Discord, at certain time intervals or when failing to place limit order.
3. Anoither EA, sitting in a different VPS, perhaps a different provider, checks for frequency of HB and messages received from the parent EA. If frequency of arrival of HB is violated or a message arrived saying the limit order failed to be placed, this external ea sends email to user that soemthing is wrong.
perhaps a daily message should also be send saying everything is fine, so that one can suspect soemthing is wrong with the secundary ea.
Personally, I still prefer the "heartbeat" method, because I can simply rent a simple webhosting service at a much lower cost than renting a VPS.
There are even "free" options for webhosting which you can easily program a simple PHP script (or some other method) to receive the "heartbeat" and then send you a simple email to a specific address (when the heartbeat fails).
Your mobile phone can easily notify you when it receives the email on that dedicated address.
You don't need a webhosting or VPS. There are some companies offering this service for free (or paid of course), you just need to send an HTTP request from your code every X seconds. If it fails you will get some notifications from the service. It's very easy.
For those interested, I have created a simple EA that sends a HB to a heartbeat monitor. Based primarily from this post. I created a function, such that you can send the HB after checking for criteria other than time. When the EA fails to send a HB you get an email saying something is going wrong. I hope it helps. If you know how to make it better, please improve.
inputint HeartbeatInterval = 60; // Heartbeat interval in secondsstring MonitorID = "Your_ID";
string APIKey = "Your_Api";
voidOnTick()
{
staticdatetime lastHeartbeatTime = 0;
// Send heartbeat at specified intervalif(TimeCurrent() - lastHeartbeatTime >= HeartbeatInterval)
{
SendHeartbeat(MonitorID, APIKey);
lastHeartbeatTime = TimeCurrent();
}
}
void SendHeartbeat(string ID, string Key)
{
string url = "https://cronitor.link/p/" + ID + "/" + Key;
string headers = "";
string response_header;
char postfxa[],fbfxa[];
ResetLastError();
int Trd=WebRequest("POST",url,headers,500,postfxa,fbfxa,response_header);
if(Trd==-1)
{
MessageBox("Go to Tools then Options and on the Expert Advisors tab add the URL for https://cronitor.link", "Error", MB_ICONINFORMATION);
}
Print(Trd);
}
Most of us use a VPS to run our trading EA's 24/7, but how to monitor if these terminals are up and running? What if they crash, or shut-down due to an update? How do I get notified
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
A good option will be to combine both:
1. place a limit order and check it was placed. this confirms the ea is working in connection with borker.
2. send HB to external plataform, may be Discord, at certain time intervals or when failing to place limit order.
3. Anoither EA, sitting in a different VPS, perhaps a different provider, checks for frequency of HB and messages received from the parent EA. If frequency of arrival of HB is violated or a message arrived saying the limit order failed to be placed, this external ea sends email to user that soemthing is wrong.
perhaps a daily message should also be send saying everything is fine, so that one can suspect soemthing is wrong with the secundary ea.
Personally, I still prefer the "heartbeat" method, because I can simply rent a simple webhosting service at a much lower cost than renting a VPS.
There are even "free" options for webhosting which you can easily program a simple PHP script (or some other method) to receive the "heartbeat" and then send you a simple email to a specific address (when the heartbeat fails).
Your mobile phone can easily notify you when it receives the email on that dedicated address.
For those interested, I have created a simple EA that sends a HB to a heartbeat monitor. Based primarily from this post. I created a function, such that you can send the HB after checking for criteria other than time. When the EA fails to send a HB you get an email saying something is going wrong. I hope it helps. If you know how to make it better, please improve.