Loading…

Chart Objects Diff Tool

A chart that has been worked on for weeks accumulates lines, rectangles and labels nobody fully remembers drawing. "What changed since yesterday" has no good answer from looking at the chart itself - MT4 keeps no object history, and a template snapshot only tells you the current state, not what moved. This tool solves it by comparing two point-in-time exports rather than trying to watch the chart live. It reads the same seven-column schema the companion "Export Chart Objects" script writes (type, name, price1, time1, price2, time2, colour) from two files and matches rows by object NAME. Anything in the new file with no matching name in the old file is reported as added; anything in the old file missing from the new one is removed; a name present in both with different anchor prices or times is moved; a name present in both with the same geometry but a different colour or object type is restyled. Objects unchanged between the two snapshots are counted but not listed, so the output stays focused on what is actually different. Matching by name rather than by content is a deliberate, stated limitation: a renamed object has no way to be recognised as "the same object, moved" - it shows up as one removal plus one addition. A CSV row genuinely carries no identity beyond the name MT4 assigned it, so this is the honest behaviour, not a bug to route around. Notes and limitations - Matching is by object name only. A renamed object appears as one removal and one unrelated addition, not as a rename - see the full description. - Only the five object types the shared export schema covers (horizontal line, vertical line, trend line, rectangle, text label) can appear in either file, because those are the only types the export side writes. Anything else on the chart was never in the CSV to begin with. - Up to 5,000 rows per file are read; a file larger than that is truncated and a warning is printed to the Experts tab. - The tool does not touch the chart or any live object - it only reads the two files and writes an optional report. Safe to run at any time.

Script · MT5 · v1.0 · Free

About Chart Objects Diff Tool

Chart Objects Diff Tool is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 3 settings, such as Old file, New file and Report file. MQL source code included.

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

Settings

SettingDefaultWhat it does
Old filechart_objects_old.csv"Before" snapshot, read from MQL5\Files
New filechart_objects_new.csv"After" snapshot, read from MQL5\Files
Report filechart_objects_diff.csvDiff report, written to MQL5\Files (blank = skip)

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 → Scripts.
  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 script onto a chart to run it once.

Download the PDF guide

Tags: Alerts · MT5 Script · MQL5 Source Code

MQL4 & MQL5 scripts · PolyMaria