AMF Guaranteed Stop for MT4
AMF Guaranteed Stop for MT4 is a server plugin for MetaTrader 4 (file CPlugin.AMF.dll). It makes your trading server insist on a protective Stop Loss on every trade and reserves enough margin to cover the loss that the Stop Loss allows. It is built for brokers who work under AMF (France) rules and need to limit the risk a client can take.
This page describes version 2.00 (MT4 Administrator shows it as 200). The MetaTrader 5 edition has its own guide: AMF Guaranteed Stop for MT5. An overview of both is on AMF Guaranteed Stop.
Contents
- Who it is for
- What the plugin does
- What the plugin does not do
- Units: points, not pips
- Requirements
- Installation
- Upgrading from an older version
- Settings reference
- Rule line format
- Masks
- Which line is used for a trade
- How the rules work in detail
- Examples
- Licence and free trial
- What the plugin sends
- When a trial or a licence ends
- Troubleshooting
- FAQ
- Limitations and differences from the MT5 edition
- Changelog: version 2.00
- Getting the plugin
Who it is for
Brokers and white-label operators who run their own MetaTrader 4 server and want every client trade to carry a Stop Loss within limits they define, with the margin of the trade covering the worst-case loss. Typical use: retail accounts of a broker that must limit client losses, with an optional fee for the guaranteed execution of the stop.
What the plugin does
For every account and symbol covered by your rules, the plugin does five things:
| # | Rule | What it means |
|---|---|---|
| 1 | Requires a Stop Loss | An order without a Stop Loss is rejected. |
| 2 | Limits where the Stop Loss may be | The distance between the price and the Stop Loss must be at least your minimum and at most your maximum (both in points). |
| 3 | Never lets the client increase the potential loss | The client may move the Stop Loss closer to the price (smaller loss). Moving it away, or removing it, is rejected. Changing only the Take Profit is always allowed. |
| 4 | Reserves margin for the worst case | The margin of a trade is the larger of (a) the normal margin of the symbol and (b) the maximum loss at the Stop Loss level. A trade is rejected with Not enough money if the free margin does not cover that amount. |
| 5 | Charges an optional premium | An extra commission, per lot, when a Stop Loss is triggered. It appears on the client's account as a separate balance operation. |
Two further optional features: a limit on the total volume (in lots) a client can hold on one symbol, and a ban on Buy Stop and Sell Stop pending orders for chosen account groups.
What the plugin does not do
- It does not change the price or the way the server executes a stop order. Execution stays entirely with the MT4 server.
- It never blocks closing a position, never closes a position by itself, and never changes a client's balance except for the premium described above.
- It does not touch accounts and symbols that no rule line covers.
- It does not remove a Stop Loss that a client has already set, and it does not close existing positions when a volume limit is exceeded.
- When it is not sure, it does nothing. If the server cannot give the plugin a price, a margin figure, a currency rate or the list of open positions, the plugin does not reject the request and does not change anything: the server handles the request exactly as if the plugin were not installed. A missing figure is never treated as zero. One exception: a request whose own volume is already above
maxPis rejected even when the list of open positions is missing, because open positions could only add to it.
Units: points, not pips
- Point means the smallest price step of the symbol. For a 5-digit quote such as EURUSD 1.10000, one point is 0.00001, so 1 pip = 10 points. For a 3-digit quote (USDJPY 150.000) one point is 0.001. All distances in the settings are in points.
- Lot means volume as shown in the trading terminal (1.00 lot, 0.10 lot).
Worked margin example. EURUSD (5 digits), buy at 1.10000 with Stop Loss 1.09500. The distance is 500 points (50 pips). With a contract of 100 000 units, 500 points is a loss of about 500 USD per lot.
| Case | Normal margin for 1 lot | Loss at the Stop Loss | Margin the plugin requires |
|---|---|---|---|
| Leverage 1:500 | 220 USD | 500 USD | 500 USD (the loss is larger) |
| Leverage 1:100 | 1 100 USD | 500 USD | 1 100 USD (normal margin applies unchanged) |
Requirements
- MetaTrader 4 server with plugin support, and the right to place plugins in its
pluginsfolder. - The
pluginsfolder must be writable for the server process: the plugin keeps its settings, its licence and a few small service files there. - Outgoing internet access from the server to
update.cplugin.com, port 443 (HTTPS), for the free trial and for automatic licence renewal. A paid licence also works without it until its end date; for a server without outgoing access, CPlugin support sends the licence file to install by hand.
Installation
- Get the licence first (see Licence and free trial). Without a valid licence or a running trial the plugin runs but does not apply any rule.
- Copy
CPlugin.AMF.dllinto thepluginsfolder of the MT4 server and restart the server. - Make sure the server can reach
update.cplugin.comon port 443. - Open the plugin in the MT4 Administrator, set the parameters (below) and set
Enable=1. - Parameters changed in the Administrator are applied immediately, no restart is needed.
Files the plugin keeps in the plugins folder: CPlugin.AMF.ini (settings), CPlugin.AMF.license (licence), CPlugin.AMF.hub.key (the plugin's own key, see What the plugin sends), CPlugin.AMF.hub.state and CPlugin.AMF.license.state (small service files).
After the start, look at the server journal: the plugin prints its version and every parameter it has accepted (config lines). Check that your rule lines are printed as you expect.
On the very first start, with no presets at all, the plugin writes an example configuration (Preset[0] Name=Basic and two example lines) with Enable=0. The examples are only a reminder of the layout: replace them with your own rules, then set Enable=1.
Upgrading from an older version
Version 2.00 needs a new licence. Please read this section before you install it.
- A licence key made for version 1.23 or earlier is not accepted. The plugin writes a journal line that begins with
license_and ends with_required(it says that a new licence is needed and gives a link and a pairing code), and it does not intervene until the new licence is installed. Orders are executed by the server as if the plugin were not installed. Trading does not stop; you only lose the protection of this plugin for that time. - The new licence is a monthly subscription. A licence bought once for an earlier version (without a monthly payment) is not converted into a new one. You can keep using the earlier version with your current licence for as long as you like.
- If you already pay a monthly subscription for this plugin, do not buy again. Write to CPlugin support before or right after the upgrade: we move your subscription to the new licence, the period you have already paid for carries over, and you do not pay twice.
- Your settings stay where they are. The settings file
CPlugin.AMF.iniis not replaced. Version 2.00 reads it more strictly and some masks mean something else (see Changes in results), so check your settings before the upgrade. - Steps:
- Make a copy of the plugin folder (the old DLL, its settings and its licence key). To go back to the old version, put the copies back.
- Replace the DLL and restart the server. Choose a quiet time: the plugin does not intervene between the restart and the arrival of the new licence.
- Take the pairing code from the server journal.
- Sign in to CPlugin Toolbox, open Billing, Licenses, enter the code (Pair server) and buy the licence (Buy license), then pay the invoice.
- After the payment is registered, the licence reaches your server by itself at the plugin's next contact with the update service. The journal then shows
license_installed. The plugin contacts the service when the server starts and then about once a day; restarting the trading server makes it contact the service right away.
Settings reference
The plugin is configured through its parameters in the MT4 Administrator (stored in CPlugin.AMF.ini). Example:
Enable=1
Verbose=1
Reject Pending Stops=0
Reject Pending Stops - Groups=demo*,test*
Commission Comment=AMF
Current Working Preset=0
Preset[0] Name=Basic
Preset[0][0]=EURUSD,GBPUSD;-1;demo*;10;500;100;3.5;USD
Preset[0][1]=-1;Forex;*;20;-1;-1;0
Preset[1] Name=NFP
Preset[1][0]=-1;Forex;*;100;1000;50;10;USD
| Parameter | Meaning | Default |
|---|---|---|
Enable | 1: the plugin works. 0: it does nothing at all (no rejection, no margin change, no premium). Only 0 and 1 are accepted. | 0 |
Verbose | How much the plugin writes to the server journal, 0 to 5. 1 is enough for daily work; 4 shows why a request was or was not checked; 5 is the most detailed (for troubleshooting only). | 1 |
Reject Pending Stops | 1: forbid Buy Stop and Sell Stop pending orders for the groups below. Only 0 and 1 are accepted. | 0 |
Reject Pending Stops - Groups | Mask of account groups for which Buy Stop and Sell Stop are forbidden (mask syntax). Works only when Reject Pending Stops=1. | none |
Commission Comment | Text for the premium operation. The comment becomes <text> #<order ticket>, for example AMF #1234567. At most 31 characters; when text and ticket together are longer, the text is shortened and the ticket is always kept whole. Keep the text short (up to 16 characters). | commission |
Current Working Preset | Number of the preset that is active, counting from 0. Only this preset is used. Switch it to change the whole set of rules at once (for example before a news release). | 0 |
Preset[i] Name | A human-readable name of preset i. Informational only. | none |
Preset[i][j] | Rule line number j of preset i (format below). Numbers start from 0 with no gaps. | none |
A change is applied only when the whole configuration is valid
Every time the settings change (in the Administrator or at the server start) the plugin checks the whole set of parameters. The journal lists every problem it finds, each with the name of the parameter.
- Any error: nothing changes. The Administrator reports that the change failed, the settings go back to what they were, and the rules that were working keep working. Fix the errors and try again.
- At the server start, if the settings contain an error, the plugin starts but applies no rule until a valid configuration is set (the journal says so with an error line).
- Warnings (for example a line that can never match anything) are written to the journal but do not block the change.
- If the settings file itself cannot be read at the start, the plugin applies no rule and refuses changes from the Administrator until the file is fixed and the server restarted, so that the rest of the file cannot be overwritten by mistake.
What counts as an error: a wrong number of fields; a number that is not a plain number (abc, 1,5, an empty field); a negative value other than -1 where -1 is allowed; minSL larger than maxSL; a Commission Comment longer than 31 characters; a control character (such as a TAB) in a mask; a mask part longer than 255 characters; Enable or Reject Pending Stops other than 0 and 1; Verbose outside 0 to 5; a Current Working Preset that does not exist; gaps or duplicates in the numbering; a value with a line break or with spaces at its start or end.
The settings file is replaced only by a complete new file, so a failed save never damages it. If another program (an editor, a backup or antivirus scan) holds the file open, the plugin tries again up to three times within about a third of a second, then refuses the change and names the Windows error in the journal; the previous settings stay in force.
Rule line format
Preset[i][j] = symbols;symbols groups;user groups;minSL;maxSL;maxP;commission per 1 Lot;currency
Seven or eight fields separated by ;. The last field (currency) may be omitted or empty.
| Field | Meaning |
|---|---|
symbols | Which symbols the line applies to, as a mask over the symbol name (for example EUR*,*USD*). -1 means "do not select by symbol name". |
symbols groups | Which symbol groups the line applies to, as a mask over the names of the symbol groups (security groups) configured in MT4, for example Forex,CFD. -1 means "do not select by group". |
user groups | Which account groups the line applies to, as a mask, for example demo*,real\std. It must match, or the line is skipped. |
minSL | Minimum distance from the price to the Stop Loss, in points. Fractions are allowed (49.5). |
maxSL | Maximum distance from the price to the Stop Loss, in points. -1 means no maximum. |
maxP | Maximum total volume in lots that one account may hold in open positions on one symbol. -1 or 0 means no limit. |
commission per 1 Lot | Premium charged per lot when a Stop Loss is triggered, in the given currency. 0 means no premium. |
currency | Currency of the premium (USD, EUR). If omitted, the account's own currency is used. |
minSL=0 or maxSL=0 is inactive. It is still chosen for the trades it covers (so it hides the lines below it), but it performs no Stop Loss, margin or volume check; only its premium and the Buy Stop / Sell Stop ban still work. The journal shows a warning for every such line at every load. If you do not want a real minimum, use 1.Masks
A mask is a short pattern that says which names or groups a rule applies to.
| Syntax | Meaning | Example |
|---|---|---|
* | Any number of any characters | EUR*, *USD*, * |
, | Separates several masks | EURUSD,GBPUSD,XAU* |
! in front of a mask | "Except". An exclusion always wins, wherever it stands in the list | !demo*,* and *,!demo* both mean "every group except those starting with demo" |
Rules to remember:
- Letters are case-sensitive:
EURUSDandeurusdare different. - Spaces after commas and at the end of a mask are ignored; spaces inside a mask count.
- Group names are compared in full.
- A mask part may be up to 255 characters; tabs and other control characters are not allowed.
-1is not "everything". It means "this field is not used for choosing". To cover all symbols write*. If bothsymbolsandsymbols groupsare-1, the line can never match any symbol and does nothing (the journal warns about it).
Which line is used for a trade
- Only lines whose
user groupsmatch the account's group are considered. - Among them, the first line whose
symbolsmask matches the symbol name is used. - If no line matches by symbol name, the first line whose
symbols groupsmask matches the symbol's group is used. - If nothing matches, the plugin lets the trade through untouched.
So a line for a specific symbol always wins over a line for a whole symbol group, wherever the two lines stand in the list. Only the active preset (Current Working Preset) is looked at.
How the rules work in detail
Opening an order
- No Stop Loss: rejected with Invalid stops (error 130). This needs no price, so it is rejected even when the server cannot give a quote.
- Distance outside
minSLormaxSL: rejected with Invalid stops. A market buy is measured from the current Bid, a market sell from the current Ask (the price at which the stop will trigger); a pending order from its own price. Distances are counted to 0.01 point. - Margin: the plugin compares the normal margin of the trade with the maximum loss at the Stop Loss (points, times the value of one point per lot, times lots, converted into the account currency, rounded to cents). A Stop Loss at break-even or in profit has no loss, so the normal margin applies. If the free margin before the trade is lower than the larger of the two, the order is rejected with Not enough money (error 134). Example: free margin 150, normal margin 100, loss at the Stop Loss 120: the order is accepted (120 is not more than 150). If the server cannot report the margin, the margin is not checked.
- A trade that does not increase the account's margin (for example a sell that hedges an open buy of the same size) is not checked against the loss at its Stop Loss.
- Maximum volume
maxP: if the new volume together with the volume already open on the same symbol is above the limit, the order is rejected with Invalid volume (error 131). Buy and sell volumes are added together (opposite positions are not netted). Reaching the limit exactly is allowed. - Orders opened by a dealer from the Manager are checked for margin and maximum volume, but not for the Stop Loss. A Stop Loss changed by a dealer is not checked either, and the margin of the position is not recalculated after it: a dealer can therefore increase the potential loss of a position without the plugin raising its margin.
Modifying an order
- Removing the Stop Loss is rejected.
- Moving the Stop Loss away from the price (lower for a buy, higher for a sell) is rejected: the potential loss may only decrease.
- For a pending order, moving its price and its Stop Loss together is rejected when the distance between them (the possible loss) grows.
- Adding a Stop Loss to an order that had none is allowed (for buys and sells).
- On an open position the new Stop Loss must still be at least
minSLpoints from the market. The maximummaxSLis checked when the order is opened, not when it is modified. - Changing only the Take Profit is always allowed.
- After every Stop Loss change of an open position the margin of the position is recalculated by the same rule: it is raised only when the loss at the new level is larger than the normal margin, and never drops below the normal margin of the symbol. The recalculation happens when the server applies the change, at the latest 15 minutes after the plugin checked it (a request held longer by a dealer is applied without it). It is skipped when the settings were changed, or the plugin was switched off or lost its licence, between the check and the server applying the change.
Pending orders
- A pending order is accepted at placement when its Stop Loss follows the rules above.
- When the pending order is about to trigger, the plugin checks the margin and the maximum volume first, and only then acts. If the margin is not enough, the pending order is deleted and
deleted[no money]is added to the end of its comment (the comment is shortened if needed). If the maximum volume would be exceeded, the pending order does not trigger and stays in place.
Maximum volume (maxP)
If a client already holds more than the limit (for instance because you lowered the limit later), nothing is closed. The client simply cannot open or trigger new volume on that symbol until the total falls under the limit again.
Margin already raised by the plugin
The plugin raises the margin of a position by changing its margin rate on the server. That change stays with the position: if the plugin is switched off (Enable=0), loses its licence, or is removed, positions already opened keep their raised margin until they are closed. The plugin does not lower it back by itself. While it works with a valid licence it recalculates the margin when the client moves the Stop Loss.
The recalculation starts from the margin the position holds at that moment and gives it the larger of two figures: the normal margin the server requires for the symbol, and the extra margin for the possible loss at the new Stop Loss. It never goes below the normal margin. A position opened before the plugin was installed, or while Enable=0, is treated the same way: it holds the normal margin, and moving its Stop Loss further away raises it. A position whose margin rate is below the server's normal rate (changed by someone else) is not touched; the journal shows a warning. In a hedged pair (a buy and a sell on one symbol) only the share of the changed position is replaced.
Premium on a triggered Stop Loss
When a position is closed by its Stop Loss and the matching rule has a non-zero commission per 1 Lot:
- The plugin first calculates everything: the premium (commission times lots, converted from
currencyinto the account currency and rounded to cents), and whether the free margin of the account covers the whole premium. - If anything is missing (no currency rate, no margin figure) or the free margin is smaller than the premium, nothing is charged and nothing is changed; an error line is written to the journal.
- Otherwise the premium is deducted from the balance by a separate balance operation with the comment
<Commission Comment> #<ticket>. - Only after a successful charge the comment of the closed trade is changed to
[Guaranteed SL Triggered].
A premium is charged once per closed order while the server keeps running: if the server reports the same close twice, the second report charges nothing. The plugin remembers the last 4 096 charged orders in memory only, so this protection does not survive a server restart. If the server refuses the balance operation, it is not repeated (a missed premium is safer than a double one) and the journal shows an error with the amount and the order, so that you can charge it by hand if the balance did not change. Positions closed by Take Profit, by the client, or by stop out do not incur the premium. A premium that rounds to 0.00 is not charged.
Forbidding Buy Stop and Sell Stop
With Reject Pending Stops=1, a Buy Stop or Sell Stop from an account whose group matches Reject Pending Stops - Groups is rejected with Trade is disabled (error 133), both when the order is placed and when an already existing order is about to trigger. Buy Limit, Sell Limit and stop-limit orders are not affected.
Examples
Demo accounts on two symbols. Accounts in groups starting with demo, on EURUSD and GBPUSD: Stop Loss between 10 and 500 points, no more than 100 lots open per symbol, premium 3.5 USD per lot.
Preset[0][0]=EURUSD,GBPUSD;-1;demo*;10;500;100;3.5;USD
All other Forex symbols. All other symbols of the Forex group, all account groups: Stop Loss at least 20 points from the price, no maximum, no volume limit, no premium.
Preset[0][1]=-1;Forex;*;20;-1;-1;0
Everyone except VIP. Every account group except those starting with vip, on all CFD symbols: Stop Loss from 50 to 2 000 points.
Preset[0][2]=-1;CFD;!vip*,*;50;2000;-1;0
A news preset. A second preset with tighter rules to switch on during news (set Current Working Preset=1 before the release and back to 0 after):
Preset[1] Name=NFP
Preset[1][0]=-1;Forex;*;100;1000;50;10;USD
Ban on Buy Stop and Sell Stop for demo and test accounts.
Reject Pending Stops=1
Reject Pending Stops - Groups=demo*,test*
Licence and free trial
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.AMF.license next to the DLL, delivered and renewed automatically by the CPlugin update service (or installed by hand). A licence can be limited to certain account groups or group owners (the company of the group): accounts of other groups are then simply not checked by the plugin.
The licence is a monthly subscription. To buy it, follow the steps in Upgrading (they are the same for a new installation): the pairing code from the journal, then CPlugin Toolbox, Billing, Licenses. Pricing is shown in Toolbox. The plugin is licensed under the CPlugin Server Plugin Licence Agreement.
When the licence file is read. The plugin reads CPlugin.AMF.license when the trading server starts, before it checks the first order, and keeps the licence in memory; the daily contact with the update service renews it and saves the renewed file. Deleting the licence file on a running server therefore changes nothing until the server is restarted. To stop the plugin at once, set Enable=0 in MT4 Administrator; that takes effect immediately, without a restart.
If the update service client cannot start (the journal says "the update service client did not start"), a valid licence file placed in the plugins folder by hand still works until its end date (the plugin re-checks the date once a minute, so it stops intervening up to one minute after the end). There is no trial, no delivery and no renewal until the server is restarted. If the journal says "the licence cannot be checked", the plugin does not intervene at all until the server is restarted.
Free trial
You do not need to register or to ask for anything to try the plugin. On its first start the plugin contacts the update service (update.cplugin.com, TCP 443) and receives a trial licence automatically.
| Length | 14 days, counted from the first trial issued for your server (the owner name and the server name of your trading platform licence). |
| What you get | The full plugin: every rule and feature, no limit on the number of trades. |
| Reinstalling | Does not restart the trial: moving the plugin, deleting its files or creating a new installation on the same server keeps the original end date. |
| Extending | Once, by 14 more days, on your request to CPlugin support (contact). Further extensions are possible only by CPlugin. |
| Servers with an older licence | No trial is issued to a server that already has a licence of an earlier version of this plugin. Such a server moves to the new licence by subscription (see Upgrading). The journal line trial_unavailable tells you when this happens. |
| Needs | Outgoing access to update.cplugin.com:443. The trial licence is valid for 48 hours and is renewed at every daily contact with the update service, so a server that cannot reach the update service does not start a trial (and does not continue after a restart). |
The server journal tells you where you are: trial_started (with the end date) on the first start, trial_ends_soon during the last days, trial_expired when it is over, and trial_needs_hub if the trial cannot be confirmed because the update service is not reachable. Each line carries the link to buy a licence.
What the plugin sends
In one sentence: the plugin tells our licence service which copy of the plugin runs on which trading server, so that your licence can be matched to that server, and nothing else. We never collect user data.
It happens when the plugin starts and then once a day, over the internet to update.cplugin.com (port 443). Each time the plugin sends:
| What | What it is in plain words | What it is NOT |
|---|---|---|
| The plugin's own key | A random code that the plugin generates by itself the first time it starts. It is the "name tag" of this one copy of the plugin, so we can tell your copy from another customer's copy. Example: a3f9...c71d. | It is not a password, not an account number and not a licence of MetaTrader or of any other software. It is not taken from your trading server at all. |
| Licence state | Whether this plugin is licensed or running as a trial, the number of that licence or trial, and the last day it is valid. Example: "trial, valid until 2026-11-11". | The licence file itself is not sent. |
| Server names | The company name and the server name as shown in your server settings. Example: "Acme Brokers Ltd" and "Acme-Live-1". We need them to attach the licence to your server. | Only these two names are read. Nothing else from your server settings or licences is read or sent. |
| Versions and times | The version of this plugin, the version of your trading server and the times the plugin started. |
What is never sent: anything about your clients or traders (names, e-mails, phones, documents), accounts (logins, passwords, balances, equity), orders, trades, prices, plugin settings, server journals, or the contents of your trading server database. The plugin has no way to send them: the message to our service simply has no place for such data.
Two more things to know. Our service sees the internet (IP) address the request comes from, as every web service does. And it never connects to your server and never sends it commands or programs: it only replies to requests that the plugin itself makes.
The complete official list of everything that is collected, the reason for each item and how long it is kept is on the telemetry page. The plugin also writes this notice and the link to your server journal every time it starts, so you can check it at any time.
When a trial or a licence ends
Nothing breaks. Without a valid licence for an account's group the plugin does not intervene. Every order is executed by the server as if the plugin were not installed: no Stop Loss requirement, no extra margin check, no volume limit, no Buy Stop / Sell Stop ban, no premium. Trading never stops because a trial or a licence ended; you only lose the protection of this plugin until you buy a licence.
What stays: positions that are already open keep the margin the plugin raised for them until they are closed (see Margin already raised by the plugin). The plugin does not lower it by itself.
There is no separate "demo mode" with a limited number of trades: the trial is the full plugin for a limited time.
Troubleshooting
| What you see | Reason and what to do |
|---|---|
| Nothing is checked at all | Enable=0; or the settings were not accepted (look for configuration rejected and the error lines before it); or there is no valid licence (a license_ line ending in _required, license_expired, trial_expired); or the licence does not cover this account group; or no rule line covers this account group and symbol; or the line has minSL=0 or maxSL=0. Set Verbose=4 to see the reason for each request (the plugin does not intervene (...), preset not found). |
| The Administrator says the change failed | The new settings contain an error; the journal lists each problem with the parameter name. The previous settings are still in force. |
| Orders rejected as Invalid stops | No Stop Loss, or the distance is outside minSL and maxSL (remember: points, not pips), or the client tried to increase the loss. |
| Orders rejected as Not enough money | Free margin is lower than the maximum loss at the Stop Loss (or the normal margin). |
| Orders rejected as Invalid volume | maxP would be exceeded. |
| Orders rejected as Trade is disabled | Reject Pending Stops=1 and the account group matches Reject Pending Stops - Groups. |
| A masked symbol or group is not found | Masks are case-sensitive; check spelling and that the field is not -1; an exclusion ! anywhere in the list removes the matching groups. |
trial_started, trial_ends_soon, trial_expired | Trial messages (see Free trial). Each carries the link to buy a licence. |
trial_needs_hub | The trial cannot be confirmed because the update service is not reachable. Open outgoing access to update.cplugin.com:443. |
trial_unavailable | This server already has a licence of an earlier version of the plugin; no trial is issued. Move to the new licence by subscription. |
A license_ line ending in _required | A licence of an earlier version is in the folder. A new licence is needed (see Upgrading). |
license_installed | The new licence has arrived. |
| "the update service client did not start" | Only a valid licence file placed by hand works until its end date; no trial and no renewal until the server is restarted. |
| "the licence cannot be checked" | The plugin does not intervene until the server is restarted. |
| Premium not charged (error line in the journal) | The free margin did not cover the whole premium, or a currency rate was not available; nothing was charged. If the server refused the balance operation, the journal gives the amount and the order so that you can charge it by hand. |
FAQ
Does the plugin change the price at which my stops are executed? No. Execution stays with the MT4 server. The plugin only accepts or rejects requests and sets margin.
Does it make us compliant with AMF? No tool can do that for you. The plugin is a technical tool that applies the rules you configure; compliance remains the broker's responsibility.
What happens to clients who have no Stop Loss now? The plugin does not remove or add a Stop Loss to existing positions. It checks new orders and changes to orders.
Can I use 0 as "no minimum"?
No: a line with minSL=0 or maxSL=0 is inactive and checks nothing. Use 1 for "no real minimum".
Is the symbol name case-sensitive?
Yes. EURUSD and eurusd are different.
Can I switch rules for news time?
Yes. Keep a second preset and change Current Working Preset; the change is applied immediately.
Can I run the plugin without internet access on the server? A paid licence works until its end date without it, but the licence file has to be delivered by CPlugin support, and a trial cannot start.
Does the plugin need a MetaTrader licence or change mine? No. The plugin's licence is for using the plugin on your trading server only.
Does the plugin read my clients' data? It does not send any (see What the plugin sends).
Limitations and differences from the MT5 edition
- Orders opened or changed by a dealer from the Manager are not checked for the Stop Loss (see Opening an order).
- The
maxSLlimit is checked at opening, not at modification. - A value of one parameter is limited to 127 characters (an MT4 limit).
- Margin that the plugin has raised stays with the position even if the plugin is switched off or the licence ends (see Margin already raised by the plugin).
| MT4 edition | MT5 edition | |
|---|---|---|
| Premium comment parameter | Commission Comment (capital C) | Commission comment (small c) |
| Selecting symbols by group | symbols groups is a mask over the symbol group (security group) names (Forex) | symbols groups is a mask over the symbol path (Forex\*) |
| Account types | Hedging only | Hedging and netting accounts; closing is never blocked, only the part that opens new exposure is checked |
| Masks | An exclusion with ! always wins | The same |
[Guaranteed SL Triggered] comment | Written only after the premium has been charged | Written when the account and symbol are covered by an active rule line; it does not say that a premium was charged |
| Error names | Invalid stops 130, Not enough money 134, Invalid volume 131, Trade is disabled 133 | Invalid stops 10016, No money 10019, Invalid volume 10014, Trade disabled 10017 |
| Premium unit | One balance operation | One commission deal per closing deal |
| Replacing the DLL | Server restart | Server restart (the plugin stays loaded until the server process ends) |
Changelog: version 2.00
Licence
- New licence from the CPlugin update service; licence file
CPlugin.AMF.licenseis delivered and renewed automatically. Licences of version 1.23 and earlier are not accepted. - Monthly subscription in CPlugin Toolbox; pairing code from the journal.
- Free trial of 14 days without registration, extendable once by 14 more days on request. The earlier trial of 100 licence checks is gone.
- When a trial or a licence ends, trading never stops: the plugin stops applying its rules.
Safety
- When in doubt, the plugin does nothing: a missing price, margin, rate or position list never causes a rejection.
- The licence is read when the server starts, before the first order.
- Settings are accepted only as a whole.
Changes in results compared with version 1.23
| Area | What changed |
|---|---|
| Settings | Accepted only as a whole. A broken line rejects the whole change and the previous settings keep working. Every problem is listed in the journal. |
minSL=0 or maxSL=0 | Still makes a line inactive, now with a journal warning at every load. |
| Masks | An exclusion (!) wins wherever it stands in the list. Earlier the first matching mask decided, so *,!demo* also covered demo groups. Spaces at the end of a mask are ignored. Group names are compared in full, not by their first 15 characters. Lists written as "exclusions first, then *" work as before. |
| Premium | The free margin must cover the whole premium (earlier, the premium for one lot). The premium is rounded once, on the total. A premium that rounds to 0.00 is not charged. |
| Margin when the server does not answer | The order is not rejected as Not enough money; the margin is not checked for that order. |
| Stop Loss in profit | Does not raise the margin; the extra margin covers only a possible loss. The loss is counted exactly (to 0.01 point). |
| Futures | The value of one point is derived from the tick value and the tick size. A futures symbol without them is not checked for the extra margin. |
| Numbers in settings | Read exactly: maxP 3.1 allows exactly 3.10 lots; a premium of 1.005 per lot is charged as 1.01. A tiny positive minSL or maxSL (below 0.0000001) keeps the line active; write 0 for an inactive line. |
| Order of work for the premium | The comment [Guaranteed SL Triggered] is written only after the premium has been charged. The premium is charged once even if the server reports the close twice while it runs. |
| First start | The example rules are valid and are written with Enable=0. |
Commission Comment | A long text is shortened so that the ticket always fits; more than 31 characters is an error. |
| Modifications | Adding a Stop Loss to a sell that had none is allowed (as for buys). A pending order may not move its price away from its Stop Loss even when the Take Profit changes in the same request. Changing only the Take Profit is always allowed. |
| Missing Stop Loss | Rejected even when the server cannot give a quote. When the plugin cannot read the order being modified from the server, the modification is not rejected. |
| Margin after a Stop Loss change | Recalculated only for the change the plugin checked and only if the server applies it within 15 minutes. |
| Open positions list | If the server returns no open positions for an account that holds margin, the plugin does not check maxP for that request (except a request that alone is larger than maxP). |
| Settings file | Saved as a complete new file that replaces the old one; the file attributes and Windows access rights are kept. |
Getting the plugin
Files can be downloaded from the CPlugin NuGet feed: CPlugin.MT4Plugin.AMF versions. Please install version 2.00 or later; this guide describes that version only.
Questions about the plugin, a trial extension or moving an existing subscription: contact us.

