Loading…

Terminal Settings Diff Tool

"It worked yesterday, something changed" after fiddling with terminal Options is a slow guessing game across half a dozen tabs, especially when the change was made weeks ago and forgotten. The fix is simple in principle - take a snapshot before, take another after, compare them - but nobody actually does that by hand, because comparing two lists of thirty settings line by line is exactly the kind of tedious, error-prone task a person will skip. This script does the comparison. Point it at two CSV files in the format TerminalSettingsDump.mq4 (catalogue S100, folder TerminalSettingsDump) writes - "setting,value,meaning" rows, with "=== SECTION ===" header rows in between - and it reports three groups: settings whose value changed between the two files, settings present in the "after" file but not the "before" one, and settings present in "before" but missing from "after". Section headers themselves are skipped, since they carry no comparable value. The trap this avoids is treating a raw text diff as good enough. A plain line-by-line file diff on two CSV dumps breaks the moment TerminalSettings Dump adds or reorders a row between the two runs (a new terminal build that reports one more property, for instance) - every line after the insertion point then reads as "changed" even though nothing about it actually did. This script matches rows by setting name instead of by line position, so an inserted or reordered row does not cascade into a wall of false differences. Notes and limitations This is a generic name/value CSV differ; it happens to be documented against TerminalSettingsDump.mq4's output format because that is the obvious pairing, but any two CSV files sharing that same three-column "setting,value,meaning" shape (with blank value+meaning marking a section header row to skip) will diff correctly, even if they were produced by a different tool. Comparison is purely textual: "10" and "10.0" are treated as two different values, not numerically equal ones, since the script has no way to know which settings are numeric versus deliberately formatted text. This tool only reports differences - it does not explain what caused them, does not undo any change, and does not know which differences are expected (e.g. a snapshot_time-style row that always differs) versus meaningful.

Script · MT4 · v1.0 · Free

About Terminal Settings Diff Tool

Terminal Settings Diff Tool is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Before file, After file and Show unchanged. MQL source code included.

Files in the download: TerminalSettingsDiff.mq4, TerminalSettingsDiff.txt.

Settings

SettingDefaultWhat it does
Before filebefore.csv"Before" CSV (in MQL4\Files)
After fileafter.csv"After" CSV (in MQL4\Files)
Show unchangedfalseAlso list rows that are identical in both
Write diff csvfalseAlso write the diff to a CSV file

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

Download the PDF guide

Tags: Alerts · MT4 Script · MQL4 Source Code

MQL4 & MQL5 scripts · PolyMaria