Symbol Suffix Normaliser
Almost every piece of shared MQL4 code that hardcodes "EURUSD" quietly breaks the moment it runs on a broker that lists it as "EURUSDm", "EURUSD.a", "#EURUSDpro" or any of the dozen other decorated forms brokers use. There is no platform function that reports the canonical name of a symbol - it has to be recognised - so this script does that recognition once and writes the result out as a plain CSV translation table that shared code, or a person, can read. Each Market Watch (or full server symbol list) name is checked against a built-in list of roughly fifty common canonical codes - the majors, the crosses, gold and silver, a handful of index and energy tickers, and the usual crypto pairs - by substring match, always preferring the LONGEST matching code so a short accidental match can never steal a result that a full pair code should have won. Whatever sits before the matched code is recorded as the prefix, whatever sits after as the suffix, because that is exactly how brokers decorate names in practice - a leading "#" or "m.", a trailing ".a", "pro" or "m". Anything that does not match the built-in list is reported separately, by name, rather than silently dropped - a broker's exotic CFD or a code not yet in the built-in list is exactly the case a user needs to see and can add via InpExtraRoots. Notes and limitations - The built-in list covers common majors, crosses, metals, a handful of index and energy tickers, and major crypto pairs - it does not attempt to cover every CFD a broker might list. Use InpExtraRoots for anything missing. - Matching is a substring search, not a broker-specific naming grammar. On an unusual symbol name where a shorter code could plausibly appear twice, the match is still deterministic (longest code wins) but is worth a quick visual check the first time. - This script only reads and reports; it does not rename anything, place trades, or modify Market Watch. Consuming the CSV in an Expert Advisor or another script is a separate step, left to the user's own code.
Script · MT5 · v1.0 · Free
About Symbol Suffix Normaliser
Symbol Suffix Normaliser is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message, shows several symbols in one panel and is set up for gold (XAUUSD). It has 4 settings, such as Scope all symbols, Extra roots and Save csv. MQL source code included.
Files in the download: SymbolSuffixNormaliser.ex5, SymbolSuffixNormaliser.mq5, SymbolSuffixNormaliser.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Scope all symbols | false | false = Market Watch only, true = every symbol the server offers |
| Extra roots | Extra canonical codes to recognise, comma separated | |
| Save csv | true | Write the translation table to a CSV file |
| Delimiter | DelimiterComma | CSV column separator |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: EURUSD · Alerts · Dashboards & Scanners · Gold (XAUUSD) · MT5 Script · MQL5 Source Code