Terminal Health Auditor
When an EA stops trading, the assumption is usually that the strategy logic broke. Just as often the cause sits one level below the strategy entirely: AutoTrading got toggled off, the terminal lost its connection, the disk filled up so logs and files stopped writing, or available memory ran low enough to make everything unreliable. None of these show up inside a strategy's own logic, because they disable it before the logic ever runs. This EA audits four terminal-wide conditions on a timer: the global AutoTrading toggle combined with this program's own trade permission, the connection status to the trade server, free disk space on the terminal's drive, and memory available to the terminal. It alerts only on a healthy-to-unhealthy transition and logs the corresponding recovery, so a condition that stays broken does not spam repeat alerts. Neither platform has an API to see which charts have an EA attached, so this deliberately does not try to inventory other charts - it audits the shared terminal-level conditions that would take every EA down simultaneously, which is the failure mode worth an automated watchdog. Notes and limitations - Cannot detect whether a specific other EA on another chart is running or has crashed - only the shared terminal-level conditions that would affect every EA equally. - The AutoTrading check reflects this program's own trade-permission result, which also depends on this EA's own "Allow live trading" (MQL4) / "Allow algo trading" (MQL5) property being enabled in its Common tab. - Read-only. It never sends, modifies or closes an order - only Alert, Print and Comment are used to surface what it finds.
Expert advisor · MT5 · v1.0 · Free
About Terminal Health Auditor
Terminal Health Auditor is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 3 settings, such as Check interval secs, Min free disk mb and Min available memory mb. MQL source code included.
Files in the download: TerminalHealthAuditor.ex5, TerminalHealthAuditor.mq5, TerminalHealthAuditor.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Check interval secs | 30 | How often to audit terminal health |
| Min free disk mb | 200 | Alert when free disk space on the terminal's drive drops below this many megabytes |
| Min available memory mb | 200 | Alert when memory available to the terminal drops below this many megabytes |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Alerts · MT5 Expert Advisor · MQL5 Source Code