How do you detect when an EA silently stops trading?

Running 2 EAs on MT5 via VPS. Recently had one go quiet for about 3 days — no crash, no errors in Experts or Journal, smiley face still there, terminal connected. It just stopped taking trades.

I only found out because I manually check the accounts every few days. Could easily have been longer.

What I'm stuck on is the detection side, not the root cause. Uptime monitors only tell me the VPS is up. Telegram notifier EAs fire when something happens — but this is the opposite problem: nothing happens, and that's the failure. Everything reported the account as healthy the whole time.

So how do you catch this?

Do you track expected trade frequency and alert when it drops to zero? Heartbeats? Something in the logs I'm missing? Or does everyone just check manually like I do?

If there's a standard solution I've missed I'd rather use it than reinvent it.

123bernardino:

Running 2 EAs on MT5 via VPS. Recently had one go quiet for about 3 days — no crash, no errors in Experts or Journal, smiley face still there, terminal connected. It just stopped taking trades.

I only found out because I manually check the accounts every few days. Could easily have been longer.

What I'm stuck on is the detection side, not the root cause. Uptime monitors only tell me the VPS is up. Telegram notifier EAs fire when something happens — but this is the opposite problem: nothing happens, and that's the failure. Everything reported the account as healthy the whole time.

So how do you catch this?

Do you track expected trade frequency and alert when it drops to zero? Heartbeats? Something in the logs I'm missing? Or does everyone just check manually like I do?

If there's a standard solution I've missed I'd rather use it than reinvent it.

I don't know of a readymade solution. You can use the MQL5 standard function, SendNotification(), to send a message to Mobile MT5 on your phone/mobile device:

Forum on trading, automated trading systems and testing trading strategies

my VPS is working but does not send push notifications

douglas14, 2025.03.25 20:21


Thanks , I will do these adjustments. Just a update, the sendnotification started working when I closed the metatrader5 window. The problem I reported above was happening when I did not close the terminal AND put the computer to hibernate.


Coders usually use that standard function to send notifications of executed trades but you can get your last position time and then compare it to TimeCurrent(), for example:

Forum on trading, automated trading systems and testing trading strategies

How to get Position opening time?

Yasin Ipek, 2023.08.29 18:14

double SonPozKarHesapla()
  {
   double _karToplam=0;
   datetime _zaman=0;
   for(int i=0; i<PositionsTotal(); i++)
     {
      ulong bilet=PositionGetTicket(i);
      long sihirliIslem=PositionGetInteger(POSITION_MAGIC);
      if(PositionSelectByTicket(bilet) && sihirliIslem==1923)
        {
         double _kar=PositionGetDouble(POSITION_PROFIT);
         datetime _zamanim=(datetime)PositionGetInteger(POSITION_TIME);
         if(_zamanim>_zaman)
           {
            _karToplam=_kar;
            _zaman=_zamanim;
           }
        }
     }
   return _karToplam;
  }
The idea is to write some code in your EA that conditionally sends a notification if your last position time is greater than 2 days ago, or whichever length of time that you prefer.
Blemoragne Catayas:

Running 2 EAs on MT5 via VPS. Recently had one go quiet for about 3 days — no crash, no errors in Experts or Journal, smiley face still there, terminal connected. It just stopped taking trades.

I only found out because I manually check the accounts every few days. Could easily have been longer.

What I'm stuck on is the detection side, not the root cause. Uptime monitors only tell me the VPS is up. Telegram notifier EAs fire when something happens — but this is the opposite problem: nothing happens, and that's the failure. Everything reported the account as healthy the whole time.

So how do you catch this?

Do you track expected trade frequency and alert when it drops to zero? Heartbeats? Something in the logs I'm missing? Or does everyone just check manually like I do?

If there's a standard solution I've missed I'd rather use it than reinvent it.

You could use an heartbeat system. I can't suggest a ready made solution here, but the principle is simple : you run some code on your MT5 platform that will send a heartbeat to an external system. If something goes wrong on MT5 side, the system will not received the heartbeat and you will get a notification.

Additionally the heartbeat can be linked with some information about your system, for example "no trade for X hours", and the external system can check these information with some triggers, to also send notification, even when the heartbeat is received correctly. (Though for your use case, you could do it directly with MQL5 as suggested by Ryan).

For the simplest of idea, just calculate the average trade count that it should take in a week and then if it is way off... you have found the answer... of course their are scientific way and utilities that can help you analyze if the system is running or not. Most of the time it can be that there were actually no signal at all. 

Building on Alain's heartbeat — what makes it work for this case is the payload. Andrew's point that there may simply have been no signal is the crux, and it's why I'd put state in there rather than trade counts. Two values on a timer: when the EA last finished an evaluation, and whether the positions it thinks it holds still match the order pool by ticket. Evaluated 30 seconds ago and the tickets reconcile — healthy, traded or not. Last evaluation four hours old — broken, and you know it without waiting on a trade that was never due.

Also worth checking whether the terminal restarted during those three days. Nothing logs it and everything looks normal afterwards — chart loads, indicators fill, positions in the tab, connection green. But statics and global arrays are session-scoped and come back zeroed. Usually that shows up as overtrading (empty position array, EA thinks it holds nothing, opens on top of a live basket), though it can go the other way: if your entries are gated on state built up over previous ticks, a reset leaves the gate shut and the EA just sits there evaluating and never acting. Worth ruling out before you build monitoring for it.

[Deleted]

The hard part is that "not trading" and "not working" look identical from the inside.

Three layers, cheapest first:

1) Last-tick heartbeat. Record the time of the last tick (or last successful trade attempt) and compare it against a threshold derived from your timeframe, not from wall-clock intuition. Silence beyond that threshold is a signal, not a pause.

2) Process liveness. A heartbeat only exists while the terminal is running, so this check cannot live inside the EA. Confirm the terminal process itself is alive — if it is not, no MQL5 logic can reach you.

3) External supervisor. Something outside the terminal has to act. Re-attach it to the already-running terminal rather than starting a second one, and back off exponentially: a restart loop that hammers the connection turns a quiet failure into a loud one.

On the point in #4 about state rather than trade count: agreed. Track the count, but persist a health flag (last heartbeat, last error) and alert on the flag — the count tells you what happened, the flag tells you whether it is still happening.

All of this is risk control, not a prediction — no signal, no performance claim.

Blemoragne Catayas:

Running 2 EAs on MT5 via VPS. Recently had one go quiet for about 3 days — no crash, no errors in Experts or Journal, smiley face still there, terminal connected. It just stopped taking trades.

I only found out because I manually check the accounts every few days. Could easily have been longer.

What I'm stuck on is the detection side, not the root cause. Uptime monitors only tell me the VPS is up. Telegram notifier EAs fire when something happens — but this is the opposite problem: nothing happens, and that's the failure. Everything reported the account as healthy the whole time.

So how do you catch this?

Do you track expected trade frequency and alert when it drops to zero? Heartbeats? Something in the logs I'm missing? Or does everyone just check manually like I do?

If there's a standard solution I've missed I'd rather use it than reinvent it.


This is more a redundancy approach than a monitoring, but based on such.

There are two aspects, first EA and Terminal, second Trading System.

Master/Slave setup:
Run the EA on same account twice, on independent machines. One in Master Mode, the other in slave. The slave monitors the account for executed trades. If the trade does not show up within a given grace period, something is up with the master. - Some action needs to be taken. To be determined.

Trade System Monitoring:
Run the Trading System on the same machine in two terminals on two independent accounts, different brokers, same symbol. Monitor each others taken trades, establish a statistical trade frequency, see if it is being kept by both systems. If the deviation is to large, something is up. - Some action needs to be taken. To be determined.

This is a birds eye view on a possible approach to redundancy and monitoring, and lacks quite some aspects, but should give a basic starting point.

I could imagine, some smart people here on the forum might contribute a few more aspects to take into account.

One simple approach is to make the alert fire on absence. Have the EA write a heartbeat in OnTimer, then run a tiny watchdog EA on another chart that checks the heartbeat age and the time since the last deal in history. If the heartbeat is stale, or there has been no trade for longer than your strategy normally goes quiet, it calls SendNotification() to your phone.

// in the trading EA, OnTimer()
GlobalVariableSet("HB_" + IntegerToString(MagicNumber), (double)TimeCurrent());

Note the watchdog should use TimeCurrent() too, and that only moves when ticks come in, so check it during market hours.

Navid Mirzaaghazadeh #:

One simple approach is to make the alert fire on absence. Have the EA write a heartbeat in OnTimer, then run a tiny watchdog EA on another chart that checks the heartbeat age and the time since the last deal in history. If the heartbeat is stale, or there has been no trade for longer than your strategy normally goes quiet, it calls SendNotification() to your phone.

Note the watchdog should use TimeCurrent() too, and that only moves when ticks come in, so check it during market hours.


"... check it during market hours" - That is one of the hardest tasks you can face, figuring out actual market hours.

Monitoring data stream is an aspect, I haven't covered. I would say, there are multiple approaches to do that. But it depends much more on specifics to a symbol, than it seems on the outside.

Comparing timestamps won't work reliably. It will produce lots of false positive alerts.

Using TimeCurrent might not capture, as it is updated by any received tick, and can be influenced by MarketWatch content.

It is probably better to have multiple sources of the same symbols data stream and compare their receival behavior to see if one of them/the monitored has failed.

Trying to rely on one broker connection for monitoring will not suffice the needs to accomplish actual monitoring based on redundancy.

Hi...@Blemoragne Catayas

Yes — I think a heartbeat/watchdog is more reliable than monitoring trade frequency alone. Trade frequency can legitimately become zero during a period when the strategy has no valid setup, so “no trades = failure” can create false alerts.

I’d have the EA periodically update a heartbeat with things like: - last successful EA execution time - last market-data update - last signal evaluation - current position/state

Then use a separate monitor to alert if the heartbeat hasn’t changed for a defined period. You can also add a second check based on expected activity, but I’d treat that as a secondary warning, not the primary health check.

In practice: EA heartbeat → watchdog checks heartbeat age → alert if stale → investigate terminal/EA state. This can catch the situation you described even when the VPS, terminal and connection all appear healthy. It also avoids assuming that an EA must trade every day.
Building on Boris’s point about completed evaluations, I’d also record why the EA exits early. “No signal” and “couldn’t check the signal because indicator data wasn’t ready” can both leave you with no trades, but they need different attention.

Update the evaluation heartbeat once the signal check actually finishes, including a normal “no signal” result. Keep a separate status for anything that prevents it from reaching that point. A timer heartbeat on its own could keep updating while the signal check never completes.

For the feed, SymbolInfoTick() (https://www.mql5.com/en/docs/marketinformation/symbolinfotick) gives you the last update for the specific symbol. Check whether that timestamp advances; a successful call alone doesn’t mean a fresh tick arrived.

If these are third-party EAs, I’d ask the developer to expose that status. A separate watchdog can see ticks and trades, but without status information from the EA, it can’t tell whether the signal check completed. Do you have access to the source code for those EAs?
Documentation on MQL5: SymbolInfoTick / Market Info
Documentation on MQL5: SymbolInfoTick / Market Info
  • www.mql5.com
The function returns current prices of a specified symbol in a variable of the MqlTick type. Parameters symbol [in]  Symbol name. tick [out]...