Execution Quality Logger
- Utilities
-
Ganzorig Munkhbayar
Test - Version: 1.0
- Activations: 5
A utility that measures how your broker fills your orders. Attach it to any one chart: it watches every deal on the trading account - orders of all Expert Advisors, manual trades from the desktop, web or mobile terminal, stop-loss and take-profit fills - and records, for each fill, what was asked for and what was received. It never opens, modifies or closes a trade on a live account.
What it records for every fill
- Requested price - the price of the order (for a pending order its level; for a stop-loss / take-profit fill the stop or target level the position carried).
- Quote at order time - many servers ("market execution") keep no requested price for a market order. Then the reference is the market quote (ask for a buy, bid for a sell) in force when the server registered the order, taken from the terminal's tick history; every fill says which reference was used ("vs requested" or "vs quote").
- Fill price and the slippage against the reference, in points and in account money, signed: + favourable, - adverse.
- Execution latency in milliseconds: from the moment the trade server registered the order to the moment of the deal.
- Spread in points at the moment the fill was reported to the terminal.
- Symbol, direction, volume, entry or exit, reason (expert, manual, mobile, web, stop loss, take profit, stop out), order type, magic number, deal / order / position tickets, comment.
Where you see it
- Panel on the chart, one row per symbol: fills, fills with a known requested price, mean / median / worst slippage, share of adverse fills, net slippage in account money, mean latency, mean spread at the fill.
- CSV file, one row per fill: MQL5\Files\ExecQualityLogger\fills_<account>.csv (open it with any spreadsheet program).
- Journal: one line per fill (optional) and one summary line per server day that had fills.
- Alerts (optional): a window and / or a push notification when one fill's adverse slippage or latency reaches your limit - at most one of each per minute; every alert is also written to the Journal.
- At attach it reads the last History_Days days of the account history into the panel and the CSV, so a new chart starts with data.
What it cannot do - please read
- No requested price. Many servers ("market execution") do not store the price an order asked for; the logger then shows requested n/a - never a made-up 0 - and measures against the quote at order time instead, clearly labelled (switch this off with Quote_When_No_Request). The quote is the last tick the terminal has at or before that moment; it cannot see a quote the server never sent. A close-by has no reference at all (n/a).
- Latency is measured with the server's own time stamps. It does not include the network time between your terminal and the server (see the ping in the terminal's status bar), nor the time your Expert Advisor took to decide. For a pending order the latency is n/a (its setup time is when it was placed).
- The spread is the quote the terminal held when the fill was reported - it is n/a for fills read from the history (made while the terminal or the logger was not running).
- Slippage of a pending order is measured against its level: a limit order can only fill at its level or better, a stop order at its level or worse.
- The CSV file grows with every fill; move or delete old files yourself.
- One logger per account in one terminal; a second chart with it waits and takes over if the first is closed.
- Strategy Tester: alone in the tester the logger has nothing to measure, so there (and only there) it opens one minimum-volume position a day with a stop loss, closes it after 6 hours, and logs those fills (Tester_Demo). The tester fills at ideal prices: its numbers say nothing about any broker.
- It measures; it does not change how your orders are executed and cannot make any strategy profitable.
Inputs
- Magic_Filter (-1) - log only fills with this magic number; -1 = every fill (all EAs and manual).
- Symbol_Filter (empty) - log only these symbols, e.g. EURUSD;XAUUSD ; empty = every symbol.
- History_Days (7) - at attach, read this many days of account history; 0 = off. (Fills read from the history have no spread and no quote reference.)
- Quote_When_No_Request (true) - when the broker keeps no requested price, measure against the quote when the order reached the server; false = n/a.
- Show_Panel (true), Panel_X (10), Panel_Y (30), Panel_Font_Size (8) - the panel.
- Write_CSV (true) - one CSV row per fill.
- Print_Each_Fill (true) - one Journal line per fill.
- Daily_Summary (true) - one Journal line per server day that had fills.
- Alert_Adverse_Points (0 = off) - alert when one fill's adverse slippage reaches this many points.
- Alert_Latency_Ms (0 = off) - alert when one fill's latency reaches this many milliseconds.
- Alert_Popup (true), Alert_Push (false) - how alerts are shown. Push notifications need the MetaQuotes ID in Tools - Options - Notifications, and the computer running the terminal must be online.
- Tester_Demo (true) - Strategy Tester only: the demonstration trade described above.
No DLL, no web requests. All texts are in English.
