Fee Creep Detector
A commission or swap rate change is rarely announced anywhere a trader is likely to see it. It lives in a symbol specification most people check once, when the account is opened, and never again. If a broker raises it, the only trace left behind is the actual money booked against closed trades - a slightly larger commission line, a slightly steeper swap charge - too small to notice trade by trade and easy to see once trades are grouped and averaged over time. This script reads every closed market order in history and groups it by symbol and by calendar month of close. Commission is normalised to a per-lot figure directly from OrderCommission() and OrderLots(), which needs no further adjustment - commission does not depend on how long a trade was held. Swap is normalised per lot AND per night held, because a two-night swap charge and a one-night one under the identical nightly rate are not directly comparable without dividing by nights first. Trades closed the same day they opened carry no overnight swap and are excluded from the swap average entirely, rather than folded in as a zero that would understate every month with more day trades in it. Each month is compared only against the month directly before it, for the same symbol, and only when both months have at least InpMinSamplesPerBucket trades - a month with one or two trades produces an average that is mostly noise, and comparing noise to noise produces false alarms. A month-over-month increase larger than InpFlagThresholdFraction is printed with the increase flagged plainly, for commission and swap independently, since a broker can (and does) change one without the other. The report does not claim to know why a rate changed - a genuine broker fee increase, a change in your own average holding period pulling the swap figure around, or a shift in which symbols you traded that month can all move the number. What it gives you is the actual monthly figure, symbol by symbol, so a real change is visible against your own trading history instead of buried in a specification window nobody reopens. Notes and limitations - Grouping is by the month the trade CLOSED, not opened. A trade that opened in one month and closed in the next is attributed entirely to its close month - the simplest honest choice for a tool auditing booked costs rather than trade-by-trade attribution. - The swap average mixes long and short swap rates together, since OrderSwap() does not separate them. A broker that changes long swap but not short swap (or vice versa) shows up as a smaller blended shift than the true per-direction change - split the audit by manually filtering to single-direction trading periods if that distinction matters to you. - A flagged month is not automatically a broker fee increase. Your own change in average lot size, holding period, or which symbols you traded that month can move the average too - the notes above explain why, read them before contacting a broker over a flag. - This is a read-only reporting tool. It does not place, modify or close any order. - Very low-frequency accounts may never accumulate InpMinSamplesPerBucket trades in a single month for a given symbol, in which case no comparison ever fires; lower the threshold if that is your situation.
Script · MT5 · v1.0 · Free
About Fee Creep Detector
Fee Creep Detector is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Symbol filter, Magic filter and Min samples per bucket. MQL source code included.
Files in the download: FeeCreepDetector.ex5, FeeCreepDetector.mq5, FeeCreepDetector.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Symbol filter | Only this symbol, blank = every symbol | |
| Magic filter | -1 | Only this magic, -1 = every magic |
| Min samples per bucket | 3 | Minimum trades in a month before it is used for comparison |
| Flag threshold fraction | 0.20 | Flag a month-over-month increase larger than this fraction |
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