Loading…

Symbol Spec Snapshot Appender

Nothing in the terminal keeps a history of what a symbol's specification looked like last month. Brokers widen stop levels, change swap rates, or resize a contract without much announcement, and the first sign is usually a rejected order or a P&L figure that no longer adds up the way a backtest assumed. By the time that happens, there is no record of what the spec was before it changed. This script reads the live specification for a chosen symbol list (or every symbol currently in Market Watch) and appends one row per symbol to a running CSV log: digits, point size, current spread, stop level, freeze level, contract size, min/max lot, lot step, margin calc mode, and swap long/short. Run it once a day (manually, from a scheduled task, or attached to a chart with an EA that calls it) and the file becomes a dated history of every value - a genuine record to diff against when something about a symbol's behaviour suddenly looks different. Every value comes straight from MarketInfo() at run time - no digit count, point size or contract size is ever assumed, since gold, indices and JPY crosses all report these differently from one another and from plain forex pairs. Notes and limitations This is a snapshot tool, not a monitor - it only records what the spec looks like at the moment it runs. It does not alert on changes by itself; compare rows for the same symbol across dates yourself, or feed the log into a separate diffing tool. The duplicate-skip check reads the existing log file before appending, which means the log grows roughly linearly with re-read time on a very large file. For daily use over normal timeframes this is not noticeable; a multi-year daily log with hundreds of symbols would eventually be worth splitting by year. A symbol that has vanished from the broker's list (MarketInfo returns 0 for MODE_POINT) is skipped and reported in the journal rather than logged with meaningless zero values.

Script · MT4 · v1.0 · Free

About Symbol Spec Snapshot Appender

Symbol Spec Snapshot Appender is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 3 settings, such as Symbol list, File name and Skip if logged today. MQL source code included.

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

Settings

SettingDefaultWhat it does
Symbol listComma-separated symbol list, blank = every Market Watch symbol
File nameSymbolSpecSnapshots.csvRunning log file, appended to on every run
Skip if logged todaytrueSkip a symbol already logged today (avoid duplicate rows from re-runs)

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