Export Market Watch Symbol List
Most brokers now carry a symbol tree that runs well past currency pairs - indices, metals, energies, individual shares, cryptocurrency CFDs - and a Market Watch list built from a mix of servers rarely matches the terminal's default view. Before scripting anything against a symbol list, or before handing a client a record of exactly what was available and how it was configured on a given day, it helps to have that list on disk rather than scrolled through by eye. The trap in a naive version of this script is currency. A script written and tested on forex pairs assumes every symbol has a base currency and a profit currency, reads them with SymbolInfoString, and either shows a wrong value or falls over the moment it reaches an index or a CFD that has neither. Neither platform raises an exception for a missing property - it fails quietly and leaves GetLastError to say so. This script checks GetLastError after every currency lookup and writes an empty CSV cell rather than a placeholder or a crash, so one instrument with no defined currency does not stop the rest of the list from exporting. The trade mode column exists because "listed" and "tradeable" are not the same thing. A symbol can sit in Market Watch fully visible while the server has trading on it set to close-only, long-only, or disabled outright - typically around a rollover, an earnings date, or a delisting. Reading SYMBOL_TRADE_MODE and writing it out in plain English catches that state without the user having to open the symbol properties dialog one instrument at a time. Selection state is the other detail that is easy to get backwards. When the script is asked to list every broker symbol rather than just the selected ones, it still needs to say which of those are the ones actually shown in Market Watch. Walking the broker's full symbol tree does not tell you that by itself, so the script first builds the list of currently selected names and checks each broker symbol against it, rather than guessing from the iteration order. Notes and limitations - Description, base currency and profit currency are whatever the broker's server has actually published for that symbol. Some servers leave these fields blank even on ordinary forex pairs, which is not a fault in the script - an empty cell means the broker did not send a value, not that the lookup failed silently. - The trade mode reflects the server's setting at the moment the script runs. It can change between one export and the next, particularly around news, rollovers or a symbol being delisted. - Digits comes from the symbol's own metadata, which requires the symbol to be selectable by the terminal; a symbol the broker has removed entirely will not appear in either list. - The log table truncates long descriptions to keep the columns aligned in a fixed-width font. The CSV file always carries the description in full. - Exporting the full broker tree on a server with several thousand symbols can take a few seconds and produces a correspondingly large file.
Script · MT5 · v1.0 · Free
About Export Market Watch Symbol List
Export Market Watch Symbol List is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 2 settings, such as Selected only and Csv delimiter. MQL source code included.
Files in the download: ExportSymbolList.ex5, ExportSymbolList.mq5, ExportSymbolList.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Selected only | true | Market Watch symbols only (false = every broker symbol) |
| Csv delimiter | , | 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: Bitcoin & Crypto · Alerts · MT5 Script · MQL5 Source Code