Slippage Control plugin for MT5
SlippageControl for MT5 is a server plugin (CPlugin.SlippageControl64.dll) that decides the fill price of stop losses, take profits, pending orders, stop-outs and market orders. A price has to be confirmed by a run of consecutive ticks before it is used, and the broker picks which price of that run wins. This is the MetaTrader 5 edition of the MT4 plugin of the same name: the rules, parameter names and journal format are the same wherever the two platforms allow it — see Differences from the MT4 version. The MetaTrader 4 edition has its own guide: Slippage Control plugin for MT4. The product page Slippage Control compares both editions.
How it works in MetaTrader 5
MetaTrader 5 has no plugin hooks for "stop loss triggered" or "pending order triggered". Instead, on every tick the server itself creates a server trade request — activate SL, activate TP, activate a pending or stop-limit order, stop out a position — and routes it the same way as a client request.
SlippageControl works as a dealer: the broker routes the request types to be controlled to the plugin's manager login (action ACTION_DEALER), the plugin holds each request while it counts ticks, then confirms it with the price chosen from the tick window — after that price has passed a safety check. A request the plugin does not handle (disabled, group or symbol not matched, outside news hours, ticks * = 0, no licence) is never taken: it continues through the broker's next routing rules exactly as if the plugin were not installed.
Installation
Check the prerequisites
None. The plugin is linked against the static runtime, so no Visual C++ redistributable has to be installed on the server.
Download the plugin
A fully working, time-limited version can be downloaded here: CPlugin.SlippageControl64.dll.
Deploy
Copy the .dll file into the Plugins folder of the MT5 trade server and add it in MT5 Administrator (Plugins).
Create a dealer manager
Create a manager account (or use an existing one) with the dealer right (RIGHT_TRADES_DEALER) and access to the client groups the plugin is to serve. Its login goes into the manager parameter — without a manager the plugin takes no requests at all.
Add routing rules
Add routing rules with the action ACTION_DEALER to the manager login, for the request types you want controlled: SL activation, TP activation, pending/stop-limit activation, stop out of a position, and optionally market orders (instant, market, request, exchange execution). Keep the broker's own rules for the same request types below the plugin's rules, so a request the plugin declines continues to the next matching rule.
update.cplugin.com, TCP 443) and receives a trial licence automatically: 14 days of the full plugin, no limit on the number of trades or executions, with one extension of 14 more days available on request to CPlugin support. When a trial or a licence ends, nothing breaks — the plugin declines its routing rule and the server works as if it were not installed. Full terms are on the product page.Settings
Parameters are set in the plugin configuration in MT5 Administrator (not an .ini file next to the DLL, unlike MT4) and apply immediately, without restarting the server. Parameter names match the MT4 version wherever the meaning is the same.
Scope — who is affected
| Parameter | Default | Meaning |
|---|---|---|
enable | 0 | master switch; 0 — the plugin takes no requests |
manager | 0 | login of the dealer manager the routing rules point to; 0 — the plugin takes no requests |
groups | * | group mask in MT5 notation, e.g. *,!demo* for "everything except demo" |
symbols | * | symbol mask; matches either the symbol name or its path in the symbol tree (e.g. Forex\*) |
news count | 0 | number of news periods, 0..1024 |
news time N | — | period N = 1..news count: 25/12/2026 14:30 90 (date, time, duration in minutes) or fri 15:30 60 (weekday, time, duration) |
An exclusion (!) wins regardless of its position in the mask. If no news period is configured the plugin works around the clock; with periods configured, only inside them.
Confirmation — how many ticks
| Parameter | Default | Applies to |
|---|---|---|
ticks SL | 3 | stop loss activation |
ticks TP | 3 | take profit activation |
ticks Pending | 3 | buy/sell limit, buy/sell stop and stop-limit activation |
ticks Stopout | 3 | stopout of a position |
ticks Open | 3 | market request that opens or increases a position |
ticks Close | 3 | market request that closes a position |
ticks counting mode | satisfied | satisfied or following, for SL, TP and pending orders |
0 disables the plugin's involvement for that request type completely. satisfied means the last N ticks must all satisfy the trigger condition; following means the window is the triggering tick plus the N − 1 ticks after it, not re-checked. Stopouts are always answered the moment the request arrives, from the last N ticks seen; market orders always use the N ticks that arrive after the request.
Price — which tick wins
| Parameter | Default | Accepted values |
|---|---|---|
stop loss mode | last | first, last, best, worst, order, fair-worst |
take profit mode | order | same |
stop order mode | last | same; also used for stop-limit orders |
limit order mode | last | same |
stopout mode | last | first, last, best, worst |
open mode | last | first, last, best, worst, order |
close mode | last | first, last, best, worst, order |
worst/best are the worst/best price of the window for the client; first/last are the first/last tick of the window; order is the SL/TP/order level itself; fair-worst is the worst price that is still not worse than the level for the client (falling back to worst/refusal if none qualify). Unsupported combinations are corrected at startup with a journal warning: stopout mode=order → first, stopout mode=fair-worst → best, open mode/close mode=fair-worst → worst.
Holding and operations
| Parameter | Default | Meaning |
|---|---|---|
hold timeout | 60 | seconds a request may be held without a decision, 1..170 (MT5 withdraws a held request after 180 seconds) |
timeout action | market | after hold timeout: market confirms at the last quote (a take profit/limit order only if not worse than its level, otherwise rejected), reject rejects the request |
comment order | 0 | 1 — a request confirmed at the plugin's chosen price gets the [gap] prefix in its comment (cut to 31 characters, the MT5 limit) |
verbose | 1 | journal detail: 0 errors/warnings, 1 + every decision, 2 + debugging detail |
Worked example
A long position with SL = 1.2000, ticks SL=3, ticks (as bid): 1.2010, 1.1995 (trigger), 1.1990, 1.2003, 1.1985, 1.1992, 1.1988.
following— the window is ticks 2-4:[1.1995, 1.1990, 1.2003], confirmed at tick 4.worst(sell, lowest bid) gives 1.1990;best1.2003;first1.1995;last1.2003;order1.2000;fair-worst1.2003 (only price not worse than 1.2000 for the client).satisfied— held from tick 2; the last three ticks are checked againstbid <= 1.2000on every tick. The window only clears at tick 7 ([1.1985, 1.1992, 1.1988]), confirmed there —worst1.1985.
What the plugin will and will not do
- Never fills at the wrong side of the quote. A buy is always filled at
ask, a sell atbid. - Never fills at a zero, negative or broken price.
- Never fills a take profit or a limit order worse than its level, whichever mode is chosen — stop losses and stop orders are the exception on purpose (protecting against a gap is what the plugin is for).
- Never closes a stopout on an old decision — it is answered the moment it arrives, from the ticks seen up to that moment.
- Never guesses. If something does not add up (the position is gone, a level is missing, the mode does not apply), the plugin does not intervene and writes the reason to the journal.
A refusal before the plugin has taken the request sends it to the broker's next routing rules. MT5 cannot hand a taken request back, so a refusal afterwards is answered at the current market price — if that price itself passes the checks — or rejected. Refusal codes (written to the journal as warnings): LIMIT_VIOLATION, INCOMPLETE_WINDOW, INVALID_PRICE, UNSUPPORTED_MODE, WRONG_QUOTE_SIDE, STALE_CONTEXT.
Journal
verbose levels are cumulative; refusals are written as warnings at every level, confirmations only after the server accepts the answer. Typical lines:
'1008': #504855410 'stop loss' held, satisfied mode, 3 ticks
'1008': #504855410 'stop loss' confirmed at 1.19900, 'worst' from [1.19950, 1.19900, 1.19980]
'1008': #504855412 'take profit' refused LIMIT_VIOLATION ('worst' 1.19950 is worse than 1.20000, 3 of 3 ticks from [1.20100, 1.19950, 1.20200]), confirmed at market 1.20200
Differences from the MT4 version
MT5 has no stop/pending/stopout hooks, so the plugin works as a dealer and needs a manager and routing rules instead of an .ini file next to the DLL. manager is required for any work. Two new parameters, hold timeout and timeout action, cover MT5's three-minute limit for held requests. Group masks follow MT5 rules; symbol masks match the symbol path.
Not available in MT5 (platform limitations, not omissions): dealer bypass * (the trade server does not tell the plugin which feeder produced a quote), stopout retried on the history of close attempts (MT5 creates a stopout request once), the virtual dealer's own stop/freeze level checks (MT5 performs them itself before the request reaches the plugin), debug symbols (verbose=2 traces every request instead).
The full contract, every worked example and the complete parameter reference ship in the readme.md of the package itself.

