Loading…

Indicator Health Watchdog

A custom indicator an EA or a trader depends on can stop working without throwing any visible error - a broken input, a symbol it cannot handle, an internal calculation that starts returning EMPTY_VALUE or simply freezes on its last good number. Nothing in the terminal flags this on its own; it is usually discovered by eye, after the fact, once whatever depended on it has already been trading (or not trading) on stale information. This watchdog polls up to three named indicators on a timer and classifies each one's recent closed-bar readings into one of three states: OK, EMPTY FLOOD (too many consecutive EMPTY_VALUE readings in the recent window), or FROZEN (the same value repeated across the recent window while the chart itself keeps advancing). Alerts fire on a cooldown per watched indicator so a genuinely dead tool does not spam the same alert every poll, and a small on-chart panel keeps the current status visible at a glance. The one honest limitation: iCustom() in MQL4 is called with only a buffer-index and a shift argument, so every watched indicator runs on its OWN default input settings - there is no generic way to forward an arbitrary parameter set through iCustom's fixed argument list. This is the same limitation the catalogue's Universal Divergence Engine documents. If a specific parameter set matters for the watched indicator, attach it to a chart first with those settings so its defaults already match what this watchdog reads. Notes and limitations - Every watched indicator runs on its own default inputs; there is no way to forward custom parameters through iCustom's fixed argument list. See the full description above. - "Frozen" and "empty flood" are read from CLOSED bars only, so a brand new attachment needs enough history loaded before either check has enough data to be meaningful. - A legitimately flat indicator (e.g. a state flag that spends long stretches at one fixed value by design) can trip the frozen check as a false positive - raise InpFrozenCheckBars or accept the occasional false alarm for that specific tool. - This watchdog cannot see WHY a watched indicator died (compile error, wrong symbol, a runtime division by zero inside it) - only that its output looks unhealthy. Open the watched indicator itself to diagnose the actual cause.

Indicator · MT4 · v1.0 · Free

About Indicator Health Watchdog

Indicator Health Watchdog is an indicator for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 11 settings, such as Watch1 name, Watch1 buffer and Watch2 name. MQL source code included.

Files in the download: IndicatorHealthWatchdog.ex4, IndicatorHealthWatchdog.mq4, IndicatorHealthWatchdog.txt.

Settings

SettingDefaultWhat it does
Watch1 nameWatched indicator #1, name relative to Indicators\ (blank = unused)
Watch1 buffer0Watched indicator #1, buffer index to read
Watch2 nameWatched indicator #2, name relative to Indicators\ (blank = unused)
Watch2 buffer0Watched indicator #2, buffer index to read
Watch3 nameWatched indicator #3, name relative to Indicators\ (blank = unused)
Watch3 buffer0Watched indicator #3, buffer index to read
Empty flood bars20Consecutive EMPTY_VALUE closed bars that counts as "flooding empty"
Frozen check bars30Consecutive closed bars checked for an identical, unchanging reading
Frozen epsilon0.0000001Two readings within this distance count as "the same value"
Alert cooldown minutes15Minimum minutes between repeat alerts for the same watched indicator
Check interval seconds5How often the watchdog re-checks (timer-driven, not tick-driven)

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 → Indicators.
  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 indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Alerts · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria