Loading…

Duplicate Attachment Warner

Attaching the same indicator twice with two different settings by accident - one leftover from testing, one the real one - is a common source of confusing, contradictory chart signals. Native MQL4 has no function that enumerates other indicators on a chart or reads their input parameters (ChartIndicatorsTotal/ChartIndicatorName exist only on MQL5), so a tool cannot discover this automatically the way an MQL5 program could. This tool works around that gap with a self-registration convention instead of pretending to see indicators it structurally cannot see. It publishes its own tiny hidden chart object holding two things: a watched-name label (typed by the user, since it is only a label - "MovingAverage", "MyRSI", whatever the copies being tracked are) and a short text signature describing that particular copy's own parameters ("14,SMA,Close"). Every copy of this warner sharing the same watched name compares signatures against every other copy's registry entry on a timer, and raises a Comment() warning the instant two entries for the same watched name disagree. It cannot inspect a third-party indicator's real inputs - it relies on the user typing an honest signature for each copy - but within that constraint it correctly and automatically detects the "I forgot I already had one of these on this chart with different settings" case. Notes and limitations - Only detects conflicts between copies of THIS warner sharing the same InpWatchedName - it has no way to inspect any actual third-party indicator's real compiled parameters, by the platform limitation explained above. The signature text is only as honest as the person typing it. - The warning is a chart Comment(), which any other indicator/script calling Comment() on the same chart will overwrite - this is a visibility tool, not a persistent log. - Each instance parks a small hidden chart object off-screen to act as its registry entry and removes it on OnDeinit; removing this warner from a chart removes that copy's entry from the shared count.

Indicator · MT5 · v1.0 · Free

About Duplicate Attachment Warner

Duplicate Attachment Warner is an indicator for MetaTrader 5. It has 3 settings, such as Watched name, Parameter signature and Recheck seconds. MQL source code included.

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

Settings

SettingDefaultWhat it does
Watched nameMovingAverageName of the indicator you are tracking (same text on every copy)
Parameter signature14,SMA,CloseShort text describing THIS instance's own parameters
Recheck seconds5How often to re-scan for other instances

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: Buy/Sell Arrows · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria