Delayed Swaps plugin for MT4
Delayed Swaps for MT4 is a server plugin (CPlugin.DelayedSwaps.dll) that postpones swap charges: a position pays no swap until it has been open for the number of days you set. Optionally, every swap charged or paid to a client is mirrored on one account of yours (the swap account). The MetaTrader 5 edition has its own guide: Delayed Swaps plugin for MT5.
What it does
Every night the trading server calculates the swap of each open position and asks the plugin first:
| The position is… | What happens to the client's swap | What happens on the swap account |
|---|---|---|
younger than Days full days | no swap tonight — skipped for good, never collected later | nothing |
Days full days old or older | charged or paid as usual, including three days on the triple-swap night | mirrored per the rules below |
outside Groups/Symbols, or no licence | charged or paid as usual — the plugin does not touch it | nothing |
"Full days" are whole 24-hour periods since the position opened. The plugin never changes a swap rate, never collects a skipped swap later, never touches balances other than the swap account, and never moves money with a currency conversion.
Days restarts every night — it never leaves the delay. Use Groups/Symbols to keep such positions out, or set Days=0.Installation
Check the prerequisites
Visual C++ Redistributable for Visual Studio 2022 must be installed on the server.
Download the plugin
The latest file can be downloaded directly: CPlugin.DelayedSwaps.dll.
Deploy
Stop the MT4 server, copy the DLL into the server's plugins folder, and put your settings into CPlugin.DelayedSwaps.ini (start from the shipped .example file). The plugins folder must be writable by the server process: the plugin keeps its licence and key files there. Allow outgoing connections to update.cplugin.com on TCP port 443, then start the server.
The configuration and the licence are named after the DLL itself: renaming the DLL means renaming the .ini and .license files the same way, and a renamed copy counts as a separate installation.
Settings
Settings live in CPlugin.DelayedSwaps.ini next to the DLL and can also be changed in MT4 Administrator (Plugins) without a restart. Missing parameters are added with their defaults on start.
| Parameter | Default | Meaning |
|---|---|---|
Days | 30 | Full days a new position pays no swap. 0 switches the delay off (swap account rules still apply). 0..36500. |
Swap Account | 0 | Login of the account that receives the mirror operations. 0 — no operations. Must exist and share the client's deposit currency, or nothing is posted for that client. |
Swap Account Charged | credit | What the swap account gets when the client pays a swap: credit receives the amount, debit takes it, none does nothing. |
Swap Account Credited | debit | What the swap account gets when the client receives a swap: debit takes the amount, credit adds it, none does nothing. |
Groups | * | MT4 group masks; ! excludes. |
Symbols | * | MT4 symbol masks (names or symbol groups); ! excludes, and a symbol excluded by name stays excluded even if its group matches a later mask. |
Each mirror operation is a balance operation on the swap account with the comment Swap L<login> #<ticket>. On the triple-swap night the server hands the plugin the full three-day amount; the plugin never multiplies it itself.
settings (set): parameter 'Swap Account': not_integer (...)) — the previous settings stay in force. If the server starts with wrong settings, the plugin does not intervene at all until you fix them.Days=0 and Swap Account=0 instead.Server journal
| Line | Meaning |
|---|---|
settings (...) accepted: Days=..., Swap Account=..., ... | settings taken into force |
settings (...) rejected: ... | settings refused |
rollover check: ticket ... value ... -> ... | the first 20 positions after every start |
rollover summary: calls=... deferred=... left_to_server=... posted=... | at most once a minute during the nightly swap run |
posting REFUSED by the server: ... | a swap account operation was refused; the client's swap is unaffected |
no licence in force since start / licence no longer in force | the plugin does not intervene |
Licensing
To work, the plugin needs a licence for using it on your trading server. It is not a MetaTrader licence — your agreement with MetaQuotes is not affected. The licence is the file CPlugin.DelayedSwaps.license next to the DLL, delivered and renewed automatically by the update service (or installed by hand), and can be limited to certain account groups or group owners.
Free trial
You do not need to register or to ask for anything. On its first start the plugin contacts the CPlugin update service (update.cplugin.com, TCP 443) and receives a trial licence automatically: 14 days of the full plugin, no limit on positions or swaps delayed, with one extension of 14 more days on request to CPlugin support. The trial licence is valid for 48 hours at a time and renewed at every contact with the update service — a server that cannot reach it cannot run a trial.
Upgrading from version 1.x
- A new licence is needed — version 2.00 works only with the subscription licence described above; version 1.x keys are not read. Keep your old DLL and licence key until the new version works, as the way to roll back.
- Settings are checked strictly: a typo in a parameter name, a non-numeric value or a
Swap Accountthat does not exist is refused instead of silently ignored. - Symbol masks: a symbol excluded by name (
!USD*) is no longer re-included by its symbol group.

