Execution Cost and Fill Quality Auditor
- Utilities
-
Jevon Naldo Yoshield
MetaTrader 5 developer and trader. I make indicators and small utilities, mostly for my own trading and a few clients. The free tools come first; the paid ones exist to fund them, not the other way around. - Version: 1.0
- Activations: 20
Shows what each closed trade earned after commission, swap and fees, by symbol, session, hour, weekday or month.
FEATURES
- Rebuilds each trade from its deals, costs apart from gross.
- Net result, R, summary, breakdowns, cost alarm, CSV export.
HOW TO USE IT
1. Attach it to a chart.
2. Choose the window and table.
3. Read the panel or export the CSV.
PARAMETERS
InpRange, InpFilterMagic, InpRiskPercent, InpFixedStopPips, InpBreakdown.
LIMITATIONS
- Trades opened before the window are counted, not reconstructed.
- R is relative, not the risk taken: the percentage model uses the balance or equity at attach time.
- Costs and prices come from the deals; R comes from your risk model.
- The cost budget fires when the cost exceeds the configured share of gross profit. Cost is shown as a positive amount; the deal records keep their own sign.
- Fill deviation is not reported. The panel is empty in the Strategy Tester, which reads account history.
COMPATIBILITY
Any symbol, netting or hedging. Native MQL5, no DLLs.
SUPPORT
Questions through the MQL5 message system. First reply within two working days.
MEASUREMENT DISCLOSURE
The costs, the volume and the prices this tool reports are read directly from the deal records. The R multiple is not: it is derived from the risk model you configure, so it is a relative measure against your own configured risk. Fill deviation is deliberately excluded, because MetaTrader does not retain the quote an order was originally priced against.
That statement holds for the default setting, which audits the whole account. If you set a magic filter, a position built by more than one Expert Advisor cannot be reported exactly, because the filtered out leg leaves volume and entry price describing only part of the position while profit and cost cover all of it. Rather than print a row that does not reconcile, those trades are counted and disclosed on the panel in the same way as trades that opened before the selected window.
PARAMETERS IN DETAIL
- InpFilterMagic: audit one Expert Advisor by magic number. 0 audits the whole account. Manual trades carry no magic number set by an Expert Advisor, so any filter excludes them.
- InpRange: the audit window. Last 24 hours, 3 days, 7 days, 30 days, 90 days, or a custom number of days.
- InpCustomDays: the number of days used when the custom option is selected. Between 1 and 3650.
- InpRefreshMinutes: how often the audit is repeated, in minutes. The minimum is 1.
- InpRiskPercent: the percentage you intend to risk on each trade, used to turn every trade into an R multiple. It applies one flat money figure to every trade, so it is accurate only when position sizing is constant.
- InpFixedStopPips: an optional fixed stop distance in pips. When set, it overrides the percentage model and gives a more faithful R figure across different symbols and sizes.
- InpUseEquity: take the percentage model from equity instead of balance.
- InpBudgetAlert: turn the cost budget monitor on or off.
- InpBudgetPct: warn when commission, swap and fees exceed this share of gross profit. Default 25. Cost is shown as a positive amount, while the deal records keep their own sign. The budget is only evaluated once there are three closed trades and the gross result is positive.
- InpAlertPopup: raise a terminal popup and a journal entry when the budget is exceeded.
- InpCorner, InpOffsetX, InpOffsetY, InpBgColor, InpBorderColor, InpHeaderColor: panel placement and colours.
- InpBreakdown: which attribution table is shown, by symbol, session, hour, weekday or month.
- InpShowBreakdown: show or hide the breakdown table.
- InpCsvOnRefresh: write the CSV file on every refresh.
- InpCsvFolder: the folder under the terminal's MQL5 Files directory. The file is execution_audit.csv, one row per trade: symbol, open and close time, direction, volume, entry and exit price, gross result, commission, swap, fees, net result, holding time and the R multiple.
ATTRIBUTION NOTES
Session buckets are calculated in GMT from the offset your own terminal reports, in five buckets: Asia, London, New York, the London and New York overlap, and off hours. The hour table is in server time, not GMT. The offset is read once when the tool is attached, so if your broker changes its offset for daylight saving, re-attach the tool after the change.
The percentage risk model and the assumed stop distance model are alternatives, not a pair. Set the stop distance and it overrides the percentage, because a distance is volume aware and therefore stays faithful across symbols and sizes.
The panel refreshes on the interval you set and reads nothing else. It opens no positions, places no orders and modifies nothing on the account.
