Attachment Map Auditor
A multi-chart setup - one EA per pair, or per timeframe - depends on every chart reattaching correctly after a terminal restart, a crash, or a VPS reboot. MetaTrader does not confirm this on its own: a chart that failed to reattach, or came back with the wrong symbol or timeframe, sits there quietly not trading, and nothing draws attention to it. Neither MQL4 nor MQL5 gives one running program a way to ask "what EA is running on that other chart" - there is no property, on either platform, that names the expert attached to a chart other than the one making the call. This tool works around that gap with mutual registration: attach the same AttachmentMapAuditor to every chart that is supposed to be running one, and each instance writes a heartbeat GlobalVariable under a shared naming convention. Any instance can then see every other instance that is alive, because GlobalVariables are shared across the whole terminal, not just the chart that set them. The intended layout is typed into InpExpectedLayout as a plain Symbol:PeriodMinutes list. Right after every restart - and again on a slower repeating cadence - each instance compares that list against which heartbeats are actually present and fresh, and alerts on anything missing or anything unexpected that is not part of the intended layout. The tool never touches an order, a position or an account property, so it carries no trading logic to port between platforms - the two versions differ only in how they read the chart's own timeframe internally, not in what they do. Notes and limitations - This only detects charts running this same EA under the shared naming convention - it cannot see an arbitrary third-party EA attached to a chart, because neither MQL4 nor MQL5 exposes a property that names another chart's expert. - Removing the EA from a chart deletes that chart's own registration immediately; a hard crash instead leaves it to expire after InpStaleAfterSec. - All charts sharing the layout must use the same InpExpectedLayout string, or each instance will audit against a different intended layout. - GlobalVariables created this way are shared across the whole terminal, so running two separate sets of charts under different intended layouts on the same terminal at the same time will cross-contaminate the audit - use one InpExpectedLayout per terminal instance.
Expert advisor · MT4 · v1.0 · Free
About Attachment Map Auditor
Attachment Map Auditor is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Expected layout, Heartbeat sec and Stale after sec. MQL source code included.
Files in the download: AttachmentMapAuditor.ex4, AttachmentMapAuditor.mq4, AttachmentMapAuditor.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Expected layout | EURUSD:60,GBPUSD:240 | Comma-separated Symbol:PeriodMinutes pairs the layout should contain |
| Heartbeat sec | 30 | How often this instance refreshes its own registration |
| Stale after sec | 90 | A registration older than this counts as gone, not present |
| Audit interval sec | 300 | How often the full layout is re-audited and reported |
| Alert on audit | true | Alert (not just Print/log) when the audit finds a mismatch |
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