Execution Slippage Audit
Every trader has a feeling about whether their broker's fills run for or against them. This script turns the feeling into a number, built from history that is already sitting in the terminal. The honest starting point is what neither platform keeps. The price the terminal originally requested is gone the moment an order fills - only the filled price survives. A script that claimed to compare "requested versus filled" would be inventing the first half of that pair. This one does not make that claim. Instead it reconstructs a reference price from the M1 bar that was open at the moment of the fill - the closest thing to a public record of where the market actually was at that second - and measures the fill against that. Read it as an estimate of execution quality, not a certified measurement of what the broker's server saw internally, because it is exactly that estimate and nothing more. The direction of the comparison matters as much as its size. A buy that filled above the reference price cost money; a buy that filled below it was a price improvement. The script signs the result so a positive number always means the fill went against the trader, on both buys and sells, rather than reporting a bare distance that hides which side benefited. Fills whose M1 bar has since rolled out of the terminal's local history, or whose symbol was never charted at M1, are counted separately as "no baseline" rather than silently dropped. A broker whose local history happens to have gaps would otherwise look artificially clean just because the worst evidence against it could not be checked. The script never computes a money value, only a pip distance derived from each symbol's own point size and digit count. There is no hardcoded contract size, tick value or pip factor anywhere in it - a 3 or 5 digit quote is detected per symbol and converted accordingly, the same way the rest of this catalogue handles pips. Notes and limitations - The reference price is an M1 bar open, not the broker's own record of the quote it offered. Two independent brokers with genuinely different feeds will produce different reference prices for the same real-world second, which is expected and part of what the comparison is measuring. - Pending orders are not included - only filled market entries have a fill to measure against anything. - A fill with no M1 bar available at its fill time is skipped from the per-symbol statistics and counted in a separate "no baseline" total. Download more M1 history and re-run to close the gap. - Balance and credit operations in history are not trades and are skipped automatically on both platforms.
Script · MT5 · v1.0 · Free
About Execution Slippage Audit
Execution Slippage Audit is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Symbol, Date from and Date to. MQL source code included.
Files in the download: ExecutionSlippageAudit.ex5, ExecutionSlippageAudit.mq5, ExecutionSlippageAudit.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Symbol | Symbol to audit ("" = every symbol in history) | |
| Date from | 0 | Range start (0 = no lower bound) |
| Date to | 0 | Range end (0 = now) |
| Magic filter | -1 | Magic number (-1 audits every magic) |
| Save csv | true | Write one CSV row per audited fill |
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: Alerts · MT5 Script · MQL5 Source Code