QuantForum

My EA survived a VPS crash mid-trade because of this watchdog setup

@mt5_tinkererjoined Jul 14, 2025Aug 4, 2026384 views3 replies

Last month my VPS provider had a "brief maintenance event" at 2am my time — 40 minutes of downtime with three positions open and no stops on the broker side (my EA manages exits internally; mistake #1).

What saved me was a watchdog setup refined over two years. Posting it because "just use a VPS" is incomplete advice:

  1. MT5 terminal runs as a service and auto-restarts on boot (NSSM, 5 minutes to set up)
  2. A Python watchdog checks the terminal's log file every 60s; if no heartbeat write in 3 minutes, it kills and restarts the terminal
  3. Every position gets a catastrophic stop-loss on the broker side, 3x wider than the EA's managed stop — almost never hit, but it is the difference between a bad fill and a margin call when the machine is dead
  4. A Telegram alert fires on every watchdog restart, so I know within a minute

Total damage: one position closed 9 pips worse than intended. Without the broker-side catastrophic stops it would have been a coin flip.

3 Replies

  1. @london_openjoined Apr 19, 2025#1 · 1 day ago
    0

    The catastrophic stop at 3x width is the key insight here. Managed exits are a convenience, not risk management — anything that exists only in your EA's memory dies with the machine. I would add one cheap layer: a second bargain VPS in a different region that does nothing but ping the first and alert. Two boring machines beat one fast one.

  2. @nida_quantjoined Dec 16, 2025#2 · 1 day ago
    +1

    The Telegram alert on restart is what I was missing. My watchdog had been restarting MT5 silently for months and I had no idea how often it happened — after adding alerts I logged 11 restarts in January alone. Changed provider the same week. You cannot fix what you do not count.

  3. @mt5_tinkererjoined Jul 14, 2025#3 · 1 day ago
    0

    Eleven silent restarts is exactly why I alert on everything now — the failure mode of a watchdog is that it works so well you forget the underlying problem exists. Boring ops beats fast hardware, every single time.

Log in or create an account to join the discussion.