DEV Community

xuks124
xuks124

Posted on

Your EA crashed at 3am — who hits the brake?

It is 3:07am. Your VPS has been flaky since midnight. The EA that opens breakout trades on M5 bars threw a trade order error thirty minutes ago — and kept going, because nobody told it to stop. When you wake up at 7am, there are eleven positions you never intended, an account drawdown you have to explain to yourself, and one question you keep postponing: who hits the brake?

The honest answer: usually nobody

Most EA setups have no brake. They have a take-profit and a stop-loss, and that is it. But anyone who has run an Expert Advisor for a season knows the failure modes that those two orders do not cover:

  • The terminal or connection dies mid-trade. Your stop-loss lives on the server, fine — until it does not, or the position you tried to close at the worst possible moment never got the response.
  • The EA keeps trading a strategy that stopped making sense. A ranging night becomes a trend morning, and the grid keeps adding.
  • Errors are logged, not acted on. MQL5 error codes scroll past in the log while the process is technically "running". A log file is not supervision.
  • You are asleep. Which is the entire reason you automated it.

Risk tools on the order side (stop-loss, position sizing) assume trades happen as planned. The 3am problem is different: the system misbehaves — a crash, a freeze, a runaway loop, a disconnected feed — and someone has to notice and act.

What a brake layer actually does

A safety layer is not a strategy and it does not need to be clever. It needs to be boring and awake:

  1. Watch the process, not the P&L. Is the terminal alive? Is the EA responding? Is the heartbeat current? Is the connection to the broker up? Crashes are visible long before the account is.
  2. Detect the abnormal states. A frozen chart, an ever-growing position count, error bursts, a terminal that restarted without its expected state. These are anomaly checks, not predictions — nobody needs to forecast price to notice that the engine is on fire.
  3. Give a human the switch. One button that says "stop opening, close what is open, flatten it now". The value of a manual kill switch is that it works while you are half-awake and scared — no config digging, no terminal gymnastics.
  4. Fail towards safety. If the watchdog itself loses sight of the terminal, the conservative default is to stop trading, not to keep going and hope.

That is the whole idea behind the tool we built for our own setups: VigilDesk — a safety layer (brake, alerts, crash detection) for MT5. It is a monitoring and kill-switch layer around the terminal and your EAs, not a trading system. The free tier is here: https://xuks124.github.io/vigildesk/free.html

Why this belongs in your stack even if nothing is wrong yet

The reason people skip a brake layer is the same reason people skip a smoke detector: nothing is burning right now. But automation changes the arithmetic. A manual trader can only lose money while awake and paying attention. An EA can lose money while you sleep, on a holiday, on a flight — and it will never once feel embarrassed about it.

Also worth saying plainly: a brake layer cannot make an EA profitable. It cannot add a single pip of edge. What it does is cap the tail — the nights when a bug, not a market, decides your drawdown. Survival first, edge second.

Practical next steps

  • Turn on alerts you will actually receive (push, Telegram, whatever cuts through do-not-disturb).
  • Write down your flat-it conditions before you need them: N consecutive errors, terminal offline for X minutes, position count above Y.
  • Test the kill switch on a demo account. An emergency control you have never pressed is a rumour, not a feature.
  • Keep the watchdog independent of the thing it watches — if the monitor runs in the same crashed process, you have built a very optimistic light.

Your EA does not need to be smart at 3am. It needs to be supervised. Somebody — or something — has to hit the brake.


Disclaimer: This article is about software and risk-control tooling, not about trading results. Nothing here is financial advice. Trading leveraged instruments such as MT5 CFDs involves substantial risk of loss; automated systems can and do fail. We make no profit promises, no return claims, and no guarantee that any tool — including VigilDesk — will prevent losses. Use at your own discretion and test on demo first.

Top comments (0)