Loading…

All Symbols Spread Snapshot

Before parking money on a symbol it is worth knowing what the broker charges just for being there. This script sweeps the Market Watch once and prints one line per symbol: bid, ask, and the spread expressed three ways - in points, in pips, and as a percentage of the current price. The percentage column is the one the table is sorted on, worst first, because raw points cannot be compared across instruments. Twenty points on an index quoted at 40000 is nothing; twenty points on a currency pair at 1.09 is a serious cost. Percentage of price is the only one of the three numbers that means the same thing on every row. The trap in the naive version of this script is the symbol that has not ticked yet. Ask the terminal for its bid and ask and you get zeros, the subtraction happily returns a zero spread, and the quietest symbol in the list suddenly looks like the cheapest one to trade. Here every symbol without a usable quote is pulled out into a separate no-data list with the reason stated - no quote yet, specification not loaded, or a crossed quote - and never appears in the main table at all. One dead symbol also never aborts the sweep; it is recorded and the loop moves on. A spread is a moving target. This is a snapshot of one moment, which is why the log header and every CSV row carry the capture time. Notes and limitations - This is one moment in time. Spreads breathe with the session; a snapshot taken at the New York close or over a weekend shows the widened numbers, not the ones you will trade at mid-session. Run it at the hour you care about. - A spread of zero is printed only when the broker genuinely streams bid equal to ask (zero-spread accounts), never as a stand-in for missing data. - The percentage is spread divided by the mid price. On symbols with very low absolute prices the percentage can look alarming while the money cost per lot is still small - read it together with the pips column. - The script reads prices only. It opens nothing, closes nothing and does not modify the Market Watch.

Script · MT5 · v1.0 · Free

About All Symbols Spread Snapshot

All Symbols Spread Snapshot 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 Scan all symbols, Export csv and Csv delimiter. MQL source code included.

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

Settings

SettingDefaultWhat it does
Scan all symbolsfalseScan every known symbol, not only Market Watch
Export csvfalseAlso write the table to a CSV file
Csv delimiter,CSV delimiter (first character is used)

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