Loading…

Alert Center Aggregator

Running several monitoring indicators at once (a stop-health check, a correlation warning, a spread monitor) usually means several separate corner panels, or several separate popup Alert() boxes competing for attention with no shared history. This panel gives every tool that wants one a single, shared feed instead: any program (EA, script, or another indicator) publishes an alert as one global variable following a fixed naming convention, and this panel finds, parses, deduplicates and displays every matching alert currently live. The interop convention is documented in full in the source header so any future tool in this catalogue - or any other MQL4 program - can publish into the same feed: ALERT_<Source>_<Slot>_<Severity>_<Message> Source is a short identifier for the publishing tool. Slot is a rolling index (0..N-1) the publisher owns, which is what bounds the global variable count over time - the publisher overwrites its own oldest slot first rather than creating an ever-growing number of variables. Severity is a single character: I for info, W for warning, C for critical. Message is free text with spaces replaced by "~", automatically truncated to fit the terminal's global variable name length limit. The variable's numeric value (set through GlobalVariableSet) is simply the publish time. Global variables can only ever hold a number, never a string, which is why the message rides in the name itself rather than the value - the one field guaranteed long enough and directly readable by any listener through GlobalVariableName(), with no shared file, no locking, and no extra permissions needed. Deduplication keys on the (Source, Message) pair rather than the raw variable name, because the same condition repeating on every tick (a stop that stays inside the noise band, for example) would otherwise fill the feed with identical rows. Repeats collapse into one row with an occurrence counter and the most recent timestamp, so a chronic warning stays visible as one line instead of crowding out everything else. Notes and limitations - This panel only reads the global variable store; it never deletes or modifies another tool's variables, so a publisher is responsible for its own slot rotation and any cleanup on shutdown. - A coincidentally ALERT_-prefixed variable from an unrelated program that does not follow the exact four-field naming convention is silently skipped rather than shown as a garbled row. - The message field's length is limited by the terminal's global variable name budget (conservatively treated as 63 characters total, including the ALERT_/source/slot/severity prefix), so long messages are truncated by the publisher - keep messages short and specific. - Global variables persist across terminal restarts by default until MetaTrader's own expiry housekeeping clears them, so a publisher that stopped running can leave a stale alert visible until InpStaleMinutes passes. - All rows are plain chart label objects, prefixed and removed cleanly in OnDeinit.

Indicator · MT5 · v1.0 · Free

About Alert Center Aggregator

Alert Center Aggregator is an indicator for MetaTrader 5. It has 11 settings, such as Max feed rows, Refresh secs and Stale minutes. MQL source code included.

Files in the download: AlertCenterAggregator.ex5, AlertCenterAggregator.mq5, AlertCenterAggregator.txt.

Settings

SettingDefaultWhat it does
Max feed rows12Maximum deduplicated alert rows shown
Refresh secs1Panel refresh interval, in seconds
Stale minutes60Drop an alert from the feed once this many minutes have passed since it was last seen
Publish demofalsePublish one demo alert on attach, to see the panel working with no other tool running
CornerCORNER_LEFT_UPPERPanel corner
X offset10Horizontal offset from the corner, in pixels
Y offset20Vertical offset from the corner, in pixels
Font size9Panel font size
Info colorclrWhiteRow colour for severity I
Warn colorclrOrangeRow colour for severity W
Crit colorclrTomatoRow colour for severity C

How to install

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

Download the PDF guide

Tags: Alerts · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria