Alert Escalation Manager
A single Alert() popup is easy to miss. It fires once, may be behind another window, and scrolls out of the terminal log within minutes. For a condition that actually matters - margin level heading toward a stop-out, the connection to the server dropping, AutoTrading getting switched off while a position is still open - firing once and moving on is not enough. This EA keeps firing. Each watched condition escalates independently: sound, popup and optionally push notification repeat at an interval that starts at InpFirstIntervalSec and shrinks by InpIntervalShrinkFactor after every repeat, down to a floor of InpMinIntervalSec, so the nagging gets more urgent the longer it goes unnoticed rather than settling into background noise. It only stops when a human clicks the on-chart ACKNOWLEDGE button for that specific condition - not when the condition happens to clear on its own, because a margin scare that resolved itself before anyone saw it is still worth knowing about after the fact from the log. Acknowledging one condition does not silence the others, and if an acknowledged condition clears and later returns, it escalates again from scratch rather than staying pre-silenced forever. Notes and limitations - This EA does not place, close or modify any trade. It only watches and alerts. - Margin level and the trading-off check both require an open position to mean anything, and are skipped with none open. - Acknowledging is per condition, tracked only for the lifetime of this EA instance - removing it from the chart or restarting the terminal resets every condition to unacknowledged. - Push notifications require the terminal's MetaQuotes ID to already be configured; this EA cannot set that up for you.
Expert advisor · MT4 · v1.0 · Free
About Alert Escalation Manager
Alert Escalation Manager is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 11 settings, such as Watch margin level, Margin level percent and Watch disconnect. MQL source code included.
Files in the download: AlertEscalationManager.ex4, AlertEscalationManager.mq4, AlertEscalationManager.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Watch margin level | true | Escalate when margin level drops below the threshold |
| Margin level percent | 150.0 | Margin level threshold, percent (only checked while a position is open) |
| Watch disconnect | true | Escalate when the terminal loses its connection to the server |
| Watch trading off | true | Escalate when AutoTrading is disabled while positions are open |
| Use sound | true | Play a sound on every escalation beep |
| Sound file | alert2.wav | Sound file, must exist in Sounds\ |
| Use popup | true | Show Alert() popup on every escalation beep |
| Use push | false | Send a push notification on every escalation beep (needs MetaQuotes ID set up) |
| First interval sec | 20 | Seconds between the first repeats |
| Min interval sec | 5 | Fastest the interval is allowed to shrink to |
| Interval shrink factor | 0.8 | Multiplies the interval after each repeat (<1 makes it more urgent over time) |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 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 · MT4 Expert Advisor · MQL4 Source Code