Loading…

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

SettingDefaultWhat it does
Scan all symbolsfalseScan every known symbol for zero-swap spec, not only Market Watch
History days90How many days of closed-trade history to search for hidden fees
Export csvfalseWrite the flagged trades to a CSV file

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: Alerts · MT4 Script · MQL4 Source Code

MQL4 & MQL5 scripts · PolyMaria