Broker Rounding Audit
A broker's reported profit on a closed trade is normally just price move times volume times tick value, but "normally" is not the same as "always" - rounding conventions, minimum price increments and the odd bookkeeping bug can all leave a trade's recorded profit disagreeing with what its own recorded prices actually imply. Spotting that by eye across months of history is not realistic, so this script recomputes every closed market trade independently and reports every ticket where the two figures do not agree. The recomputation uses tick value and tick size read live from the broker, never a hardcoded contract size or pip value, so it prices gold, indices and JPY crosses correctly the same way it prices a standard forex pair. One honest limitation drives the tolerance input: MarketInfo has no per-trade-date tick value, only today's. On a symbol whose quote-to-account currency conversion rate has moved since the trade closed, the recomputed figure and the broker's figure can legitimately disagree even though nothing was wrong at the time - this shows up mainly on cross-currency instruments held through a period of meaningful FX movement. Raise InpToleranceMoney if a symbol you audit is prone to this, and treat a flagged trade as a lead to check, not proof of a broker error. Notes and limitations - Market trades only (OP_BUY/OP_SELL); pending orders carry no fill to recheck and are skipped. - The recomputation always uses the CURRENT tick value for the symbol, not a historical one - see the FULL DESCRIPTION for why this can produce a legitimate disagreement on cross-currency instruments after their conversion rate has moved. - A symbol the terminal has no live tick value for right now (typically one not open on any chart and not in Market Watch) is skipped and counted separately as "unpriceable" rather than silently treated as agreeing. - This script only reads history; it never opens, closes or modifies a trade.
Script · MT4 · v1.0 · Free
About Broker Rounding Audit
Broker Rounding Audit is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Symbol filter, From date and To date. MQL source code included.
Files in the download: BrokerRoundingAudit.mq4, BrokerRoundingAudit.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Symbol filter | Symbol to audit ("" = every symbol in history) | |
| From date | 0 | From close time (1970.01.01 = no lower bound) |
| To date | 0 | To close time (1970.01.01 = up to now) |
| Tolerance money | 0.05 | Disagreement still counted as rounding, account currency |
| Write report file | true | Write a CSV of every flagged ticket |
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 · Alerts · MT4 Script · MQL4 Source Code