Loading…

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

SettingDefaultWhat it does
Watch margin leveltrueEscalate when margin level drops below the threshold
Margin level percent150.0Margin level threshold, percent (only checked while a position is open)
Watch disconnecttrueEscalate when the terminal loses its connection to the server
Watch trading offtrueEscalate when AutoTrading is disabled while positions are open
Use soundtruePlay a sound on every escalation beep
Sound filealert2.wavSound file, must exist in Sounds\
Use popuptrueShow Alert() popup on every escalation beep
Use pushfalseSend a push notification on every escalation beep (needs MetaQuotes ID set up)
First interval sec20Seconds between the first repeats
Min interval sec5Fastest the interval is allowed to shrink to
Interval shrink factor0.8Multiplies the interval after each repeat (<1 makes it more urgent over time)

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: Alerts · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria