Slippage Control

MT4 server plugin 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, and the broker picks which price of that run is used.

SlippageControl is a plugin for MetaTrader 4 servers. When the market gaps or runs, it decides which price a stop loss, take profit, pending order, stopout or market order is actually filled at — instead of letting a single stray tick decide it for you. It was called GAP Helper before version 2.01; the settings are the same, only the file names changed (see Upgrading).

How it works

Every order type gets two settings: how many ticks confirm it (N) and which price out of those ticks is used. For example, to fire a take profit of a BUY position the plugin can require 3 ticks in an uninterrupted sequence, all of them at or above the take profit level; when that happens it fills at the price you chose from those three ticks. If a tick of the sequence is back on the other side of the level, the order waits — a single spike from a feed glitch does not open or close positions.

The plugin handles stop losses, take profits, pending orders (stop and limit), stopouts and, through a virtual dealer, market opens and closes.

Price selection is set per order type: worst (the worst price of the sequence for the client — gap protection), best, first, last, order (the price of the order itself) and fair-worst (the worst price that is not worse than the order's level, if the sequence has one).

Tick counting has two modes: satisfied (the last N ticks at the moment the server wants to execute must all be beyond the level) and following (the tick that fired the order and the ticks after it — where the market actually went).

What it will and will not do

The behaviour is a contract that automated tests check on every build.

  • Stop losses and stop orders are protective: slippage beyond the level is what the plugin is for.
  • Take profits and limit orders are never filled worse than the price the client set. If the selected price would be worse, the plugin does not intervene and the server executes the order by its own rules.
  • It never fills at a zero, negative or not-a-number price, never on the wrong side of the quote, and never on fewer ticks than configured.
  • It never closes a position by stopout on its own; it only answers the stopout call of the server.
  • Every decision — and every refusal, with a code — is one line in the server journal, with the account, the ticket and the ticks the price was chosen from.

The ReadMe shipped with the package has the full contract: a worked example for each mode, the refusal codes and the configuration reference. Parameters of the settings file are also described in the documentation.

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: every scenario and mode, no limit on the number of trades or executions. The period is counted from the first trial issued for your server (the owner name and the server name of your trading platform licence).
  • Reinstalling the plugin, deleting its files or creating a new installation on the same server does not restart the trial.
  • One extension of 14 more days: write to us and we extend it once (self-service extension in Toolbox is coming). After that, only by CPlugin on request.
  • The trial needs outgoing access to update.cplugin.com:443. A server without outgoing access can use a licence file that our support issues for it.
When a trial or a licence ends, nothing breaks. Without a valid licence for an account's group the plugin does not intervene: orders are executed by the server as if the plugin were not installed, and market requests are left to your regular dealers. You only lose the price selection of this plugin until you get a licence. There is no separate demo mode with limited executions — the trial is the full plugin for a limited time.

The server journal tells you where you are: the end date of the trial on the first start, a warning during the last days, a message when the trial is over, and a message when the trial cannot be confirmed because the update service is not reachable. Each carries a link to get a licence.

The plugin writes a line to the server journal at every start saying what it sends to the update service. The full list — and what is never sent — is on the telemetry page.

Upgrading from GAP Helper

The plugin finds its configuration and licence by its own file name, so the three files share one base name: CPlugin.SlippageControl.dll, CPlugin.SlippageControl.ini and CPlugin.SlippageControl.license. When replacing an older build, stop the server, swap the DLL, rename your existing configuration and licence files to match the new name and start the server again; the settings themselves are unchanged. Some results differ from earlier builds — doubtful prices are refused instead of filled, take profits are no longer filled worse than their price, stopouts are priced by their own mode — and are listed in the ReadMe.

Files can be downloaded from the NuGet feed.

Comprehensive documentation can be found here. Files can be downloaded from here.