Swap Free Reality Checker
An account flagged as swap-free is supposed to charge nothing for holding a position overnight. In practice two things can go wrong: the Islamic flag is not applied uniformly to every symbol (newly added instruments are the usual culprit), or the broker replaces the swap with a flat overnight admin fee that never appears in the swap field at all, only inside the reported profit figure. This script runs two independent checks. The first reads MODE_SWAPLONG and MODE_SWAPSHORT for every symbol and lists any that publish a non-zero rate - on a genuinely uniform swap-free account this list should be empty. The second walks closed trade history and flags two things: any closed trade whose OrderSwap() is non-zero despite the account being marked swap-free, and any closed trade whose reported profit cannot be reconstructed from its entry price, exit price, volume and tick value alone. That second check is the one that catches a fee folded silently into the profit column - the residual between the reported and the reconstructed profit is the fingerprint of a charge with no honest name. Symbols with an unloaded specification are never treated as swap-free by default; a fake zero is worse than an honest "unknown". Notes and limitations - MQL4 exposes no single account-level "is this account swap-free" flag - the verdict is built entirely from the evidence described above, not read from one authoritative field. - The profit-residual check assumes a plain linear instrument where tick value is quoted per lot per tick. On metals, indices and other non-FX instruments the tolerance is widened, but a genuinely different pricing formula on an exotic symbol can still produce a false positive - treat a flagged residual as "worth checking", not proof by itself. - A trade closed within the same session (no overnight hold) never carries a swap charge on any account, swap-free or not, and will not appear in either check - this tool only has evidence for positions that were actually held overnight. - Re-run periodically. A broker can silently change a symbol's swap-free status, and this only reports the state at the moment it runs.
Script · MT4 · v1.0 · Free
About Swap Free Reality Checker
Swap Free Reality Checker is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 3 settings, such as Scan all symbols, History days and Export csv. MQL source code included.
Files in the download: SwapFreeRealityChecker.mq4, SwapFreeRealityChecker.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Scan all symbols | false | Scan every known symbol for zero-swap spec, not only Market Watch |
| History days | 90 | How many days of closed-trade history to search for hidden fees |
| Export csv | false | Write the flagged trades to a CSV file |
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: Alerts · MT4 Script · MQL4 Source Code