Order Count By Magic And Symbol
An account running several EAs turns the Trade tab into a wall of rows that answers no useful question. The question that actually matters when something looks wrong is: which EA owns what, and how much is each one carrying? This script answers it in one run. Every open position and every pending order is grouped by magic number and symbol, and each group prints its position count, pending count, open volume, pending volume and floating P/L. After each magic's block comes a subtotal row - the per-EA bottom line - and the table ends with a grand total that must match the account's own figures. Open volume and pending volume are separate columns on purpose. A pending order is not exposure until it fills, and adding the two together produces a number that measures nothing. Magic 0 is labelled "manual/unset" rather than printed as another anonymous number. That bucket collects hand trading and every EA whose magic input was left at its default - a crowded, dangerous corner of many accounts, and worth seeing named. If the manual/unset row holds more than your own hand trades, one of the robots is running unlabelled, which also means no close by magic tool can target it. The CSV export writes only the group rows, without subtotal lines. A spreadsheet recomputes subtotals in one line, and mixed-level rows break every pivot table built on the file. Notes and limitations - This is a snapshot. An EA closing or opening trades during the scan can change the book mid-run; entries that vanish mid-scan are skipped safely. Re-run for a fresh picture. - The census reports and never modifies anything. To act on what it shows, use a close-by-magic tool with the magic numbers from this table. - Floating P/L is as the terminal reports it at this moment, including weekend prices if run when markets are closed. - Grand totals cover the whole account; there is no symbol or magic filter input, because the point of a census is completeness.
Script · MT4 · v1.0 · Free
About Order Count By Magic And Symbol
Order Count By Magic And Symbol is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 2 settings, such as Export csv and Csv delimiter. MQL source code included.
Files in the download: OrderCensus.ex4, OrderCensus.mq4, OrderCensus.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Export csv | false | Also write the table to a CSV file |
| Csv delimiter | , | CSV delimiter (first character is used) |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Volume · Pending Orders · Alerts · MT4 Script · MQL4 Source Code