FX Blue Trade Mirror Sender - User guide

Author: fxblue
This is the user guide for the Sender EA which signal senders use. The guide for the Receiver app for subscribers is available separately.

1Overview of the Internet Trade Mirror

1.1Purpose of the Trade Mirror

The Internet Trade Mirror duplicates trades over the internet between copies of MetaTrader 4 running on different computers. You place trades in one copy of MT4, and these are replicated almost instantly in the receiver copies of MT4. The Mirror duplicates both manual and automated trading.

The Trade Mirror uses the same fundamental copying technology as FX Blue's hugely popular Personal Trade Copier.

Subscribers can control lot sizing and risk, can restrict the trading to particular symbols, and can even invert the original direction of the sender's trades.

The speed of copying depends almost entirely on network latency, and is therefore principally determined by geographical location and the speed of light. Slippage will usually be minimal - allowing, of course, for any differences in price and spread between the sending and receiving brokers - and slippage can in fact often be positive as well as negative.

The Trade Mirror is currently available as a free service for a limited number of subscribers. Please contact us for an increased limit, or for a version of the software which you can run from your own server rather than using FX Blue's shared message hub.

1.2Licence

Unless otherwise specified in writing by FX Blue, this software is licensed for personal use only. You are not allowed to distribute it to other people, regardless of whether or not money is changing hands. You only have a licence to use the software if you, personally, downloaded it from our website.

Therefore: you are not allowed to distribute the Receiver EA to your subscribers. They must register with FX Blue themselves, and download the EA themselves.

The software is provided entirely at the user's risk, and you should check it thoroughly before deploying it on computers trading real money. FX Blue accepts no responsibility whatsoever for any loss of any kind caused by installation or use of the software.

1.3Providing support to subscribers

As a sender of signals, you are responsible for providing support to other people who are using the Trade Mirror to copy your trades. FX Blue cannot answer queries from subscribers about your trading activity.

You should ensure that you are familiar with the Receiver EA and its settings, particularly those for controlling lot sizing and risk.

If necessary, you can give subscribers your recommended settings for the Receiver EA by creating an MT4 .set file.

2.1Installing the Internet Trade Mirror Sender

To install the sender EA, run the setup program. You can choose one or more copies of MetaTrader 4 where you want to install the EA. If any copies of MT4 are not shown, you can add them to the list using the "Find MT4" button.

You need to restart MT4 in order for its Navigator list to update - or, in newer versions of MT4, you can right-click over the Navigator and use the "Refresh" option.

2.1.1Proxy server settings

If you connect to the internet using a proxy server, you may need to configure its details. The Internet Trade Mirror uses Microsoft's WinHttp library. The easiest way to configure proxy server settings for WinHttp is as follows:

  • Open the Microsoft Internet Options settings, using the Windows Control Panel or Tools/Options in Internet Explorer
  • Use the "LAN settings" button on the "Connections" tab to enter the details of the proxy server
  • Run the following command, e.g. by clicking on the Windows Start button and then typing in the command: proxycfg -u

2.2Configuring the subscribers and their FX Blue accounts

You need an account with FX Blue in order to send trades through the Mirror. Your subscribers also need their own accounts with FX Blue.

N.B. In future, you may need an "active" FX Blue account in order to use the Trade Mirror. Signal broadcasting may be disabled if you are not actively publishing your trading results to the FX Blue website.

You control who is allowed to copy your trades by configuring the list of subscribers on the FX Blue website:

N.B. If you remove a subscriber from the list, then they will immediately lose their ability to receive any further messages from your sender EA. This may leave them with open positions which are no longer being managed.

2.3Running the Sender EA

You open a new chart for any symbol and add the "FX Blue - InternetMirror Sender" EA to the chart, by double-clicking on it in the Navigator list or dragging it onto the chart.

The EA's "Allow DLL imports" setting must be turned on.

You do not need to run multiple copies of the EA on charts for each symbol which you trade. You should only run one copy of the sender EA, on any chart. This will broadcast all trades for all symbols.

The sender EA does not need the ability to place orders. Therefore, it can be running on an account which is logged in using the read-only MT4 "investor" password.

N.B. If your account deposit is not in USD, then the MT4 Market Watch must contain the currency pair for converting to USD. For example, if your deposit currency is GBP or JPY, then the Market Watch must contain GBPUSD or USDJPY.

2.3.1Compulsory parameters for the Sender EA

You need to fill in your FX Blue username and password as parameters for the EA.

All the other parameters can normally be left at their default values, though you may want to choose a specific message hub.

2.3.2Message hub

Communication between the Sender and Receiver EAs takes place via a message hub. In future FX Blue will offer a choice of hubs in different locations. For example, a hub in Australia will offer faster trade copying if you and (most of) your subscribers are located in Australia.

You can choose which hub to use via the MessageServer parameter in the Sender EA. Subscribers must use the same setting in their Receiver EAs. If you and your subscribers are using different hubs then no heartbeats or trading messages will be received.

2.3.3Running multiple copies of the Sender EA

If you have more than one account on FX Blue you can run multiple copies of the Sender EA, broadcasting your trades to different subscribers, using different sets of parameters (e.g. different lot size).

If you are running multiple instances of the EA, then you can make it easier to distinguish between them by giving them different chart background colours and a different description.

2.4Testing the Sender

The following screenshot is an example of the Sender running successfully.

(The full-chart background is designed to reduce support queries from new MT4 users who otherwise try to run more than one EA on the same chart. The colour can be changed using the BackgroundColour setting.)

Shortly after receiving the first tick on its chart, the Sender EA should connect to FX Blue's message hub and send a "heartbeat" message.

The EA displays its current status in the top-left of the chart. If no status is visible, please see the diagnostic information.

3.1Trade placement and closure

The sender EA sends a message as soon as it detects that there is a new open order in its copy of MT4. Receiver EAs will then attempt to place the same trade.

The same applies to trade closure. As soon as it spots that a previously open order has been closed, the sender EA tells the Receiver EAs to close their trades.

Messages are sent to the subscribers via FX Blue's message hub. The speed of copying depends almost entirely on the latency to the message hub and to your broker. Differences in price between you and the subscribers can be caused both by the latency in receiving signals and also price differentials between different brokers. Subscribers may need to adjust their AllowSlippagePips parameter in order to trade successfully, or even to turn on TradeAllOrdersAtMarket.

3.1.1Speed of processing on the receiver

Please note that a Receiver EA may not be able to process new open and close instructions immediately. Orders have to be processed in sequence, and a Receiver cannot not start working on a new signal if it is currently waiting for the broker to execute a previous trade.

If two new-order messages are sent at the same time, but the receiving broker takes 5 seconds to execute the first order, then processing of the second order will take at least 5 seconds (plus the time then required to execute the second order).

3.1.2Stop-loss and take-profit on the receiver

The stop-loss and take-profit on a subscriber's trade are only a safeguard in case the connection with your Sender is lost. Under normal circumstances, the subscriber's trade will be closed as soon as your trade is closed. The Receiver EA's s/l and t/p are only used if either (a) the connection with the sender is lost and no close instruction is received, or (b) price differences between brokers mean that the subscriber's s/l or t/p is hit before your s/l or t/p.

3.2Heartbeats

N.B. The heartbeat period does not control how quickly orders are copied. Open and close messages are always sent immediately, and processed as quickly as possible.

The sender EA sends a periodic "heartbeat" message, every 30 seconds by default. This states which orders should still be open. If a Receiver misses a trade-closure instruction, e.g. because its copy of MT4 is not running at the time, then it should close the order when it next receives a heartbeat from the sender.

Changes to a trade's s/l or t/p are also sent in the heartbeat message. Therefore, there may be a delay of up to 30 seconds between the s/l or t/p changing in the sender's copy of MT4 and the Receiver making the change. However, if the trade is closed out on the sender within those 30 seconds because the s/l or t/p is hit, that should lead to an immediate close instruction being sent to the Receiver.

Changes to the entry price on a pending order are also sent in the heartbeat, and therefore updated within 30 seconds.

3.3Pending orders

By default the sender EA does not send pending orders. It only sends a message to Receivers once a pending order is filled and turns into a buy or sell order.

Copying pending orders is potentially very dangerous. Let's say that you are trading the breakout of yesterday's range, and you have a buy-stop at yesterday's high. This could get triggered on a Receiver without being triggered on the sender, because of slight price differences between the two accounts. If the price then retraces, the sending copy of MT4 will be unaware that the Receiver has a trade which needs to be managed, but the Receiver will have an ever-increasing loss and will not be receiving any instructions to close the position.

However, you can configure the Trade Mirror to send pending orders by turning on the optional IncludePendingOrders parameter. Subscribers can then use the RequireSenderFillWithinMinutes parameter to limit the risk at their end. If the subscriber's order is filled, but the sender's order remains pending, then the Receiver EA can be configured to close its order after this number of minutes (ignored if zero).

3.4Lot sizing and risk

Subscribers can use several different modes for determining what lot size to trade:

Risk-based: trade sizes are adjusted based on the subscriber's account equity compared to your equity

Multiple: a simple multiple of your trade size (regardless of different account equity, and therefore % of risk)

Fixed: a fixed lot size per trade

Cash-risk: a fixed cash risk per trade, or a % of account equity or balance, in combination with a fixed stop-loss

For more information about the options available to subscribers, please see the Receiver EA user guide.

However, in addition to the options which are available to each subscriber, you can also alter the lot size which is issued by the Sender. For example, you can configure the Sender EA's parameters to give subscribers a fixed lot size rather than the actual volume you are trading.

3.5Broker symbol names and suffixes

Some MT4 brokers use different suffixes for the same symbol. For example, some brokers may refer to EURUSD as EURUSDFXF, EURUSDcx, EURUSDi, EURUSDm etc.

The Sender and Receiver should automatically adjust between different symbol names on different brokers. If the Receiver is unable to place a trade then it is probably because the symbol is not in its Market Watch. (The Receiver EA does have a ForexSymbolSuffix parameter, but the Receiver will auto-detect this if the parameter is left blank.)

Some non-forex symbols need special mapping. For example, most MT4 brokers refer to spot gold as XAUUSD, but there are a few brokers who use a different symbol name such as GOLD.

The subscriber can use the Receiver EA's CustomSymbolMappings parameter to translate any such symbols. For example, if the your sending broker uses GOLD and SILVER and the receiving account's broker uses XAUUSD and XAGUSD, then the subscriber would need to enter GOLD=XAUUSD,SILVER=XAGUSD in the CustomSymbolMappings parameter.

3.6Market execution

Some brokers use "market execution" where an s/l or t/p has to be placed separately from a buy or sell order. The Receiver caters for this by always placing the trade first, and then setting any s/l and t/p afterwards. By default, the CloseOrdersImmediatelyIfSLFails parameter will mean that trades are immediately closed if the order placement succeeds but the s/l or t/p then fails.

3.7Hedging vs. non-hedging

At the moment the Trade Mirror does not convert between hedging and non-hedging accounts. If a Receiver is running on a broker which does not allow hedging, then trades will fail if the messages coming from the sender break the hedging rules.

3.8Magic numbers

The Receiver EA uses an order's magic number to identify which orders belong to it, versus which orders are from manual trading or other EAs running on the account. Therefore, magic numbers are also not copied from the sender account.

The Receiver EA uses the same magic number for all orders which it processes. By default, it automatically selects a magic number based on the channel name. Subscribers can choose their own magic number by setting the MagicNumber parameter in the Receiver EA to something other than zero.

3.9Partial closes

The Sender and Receiver EA are capable of handling partial closes.

However, the only way of detecting partial closes in MT4 is via the order comment. If brokers do not use the standard convention for partial closes (e.g. order comments such as "from #123456") then the software may not be able to handle partial closes correctly.

3.10Inverting trade direction

The Receiver EA can be configured to invert the sender's trade direction, turning buys into sells and vice versa. (This feature has been included at user request; we are not aware of any loss-making trading system which can be made profitable by inverting it.)

In order to use this feature, a subscriber needs to turn on the Receiver EA's InvertTrades parameter, and will also need to do one of the following:

  • Turn on the TradeAllOrdersAtMarket parameter. This means that the Receiver EA ignores the sender's entry price (because e.g. the sender is buying at the ask price whereas the receiver will be selling at the bid price).
  • Increase the AllowSlippagePips parameter, to cater for the fact that the difference between the sender's entry price and the receiver's entry price will be at least the size of the spread.

3.11Order comments

By default, the Receiver EA uses the MT4 order comment to track the ticket numbers on the sender account. The subscriber can change this behaviour, and get the Receiver EA to use the original comments from the orders on the sender account, by turning on the UseOriginalOrderComments parameter in the receiver.

Alternatively, the subscriber can use the UseCustomOrderComment parameter to use a fixed comment for all orders.

However, please note that these parameters have implications for disaster-recovery. If a subscriber turns on UseOriginalOrderComments or UseCustomOrderComment, then the ticket numbers on the sender account are tracked using a file on disk (in MT4's MQL4\files directory). If this file is deleted - or is unavailable for some other reason, e.g. because the subscriber is starting up MT4 on a new computer in an emergency - then the Receiver EA will close all its orders because it can no longer link them to the sender's heartbeat.

3.12Controlling the Sender using MT4 Global Variables

You can block the Sender from placing new trades using a Global Variable in MT4 (press F3, or choose Tools / Global Variables).

You can use this either as a way of controlling the Sender manually, by creating and removing the Global Variable yourself, or you can have an automated system which uses the Global Variable to turn the copying on and off based on something such as account equity or performance.

The Sender is controlled by a Global Variable called Suspend-X, where X is the channel name. For example: Suspend-MySender. If a variable exists with this name, regardless of its value (zero/non-zero) then the Sender EA will not issue a message to subscribers when a new trade is placed.

4.1.1Sender parameters: username and password

Server settings

Username

Your FX Blue username

Password

Your FX Blue password

MessageServer

The message hub to use. Subscribers must use the same setting which you use.

HeartbeatPeriodSeconds

The number of seconds to wait between sending each heartbeat message

4.1.2Sender parameters: orders to include

Orders to include

IncludeSymbols

If not blank, a comma-separated list of symbols to include in the messages to the receiver. This must exactly match the broker's names, including upper/lower case such as EURUSDfx,GBPUSDfx. Trades for symbols which are not on this list are not included.

IncludeMagicNumbers

If not blank, a comma-separated list of EA magic numbers to include in the messages to the receiver. For example, 0,1234,6789 will include manual orders (which have magic number 0), plus orders from the EA(s) which use the magic numbers 1234 and 6789

IncludeOrderComments

If not blank, a comma-separated list of order comments to include. For example, pivot,breakout will only include orders whose comment includes either "pivot" or "breakout". The match is case-sensitive. You can also match an exact order comment using quotes. For example, pivot,"breakout" will match an order whose comment includes "pivot" (e.g. pivot123), or an order whose comment is the exact text "breakout".

IncludePendingOrders

Determines whether pending orders are sent, or whether the broadcaster only sends messages when trades are filled.

4.1.3Sender parameters: lot sizing and pricing

Lot sizing and pricing

(Lot sizing can also be changed using the settings in the Receiver EA)

UseFixedLotSize

If not zero, the EA will send this fixed lot size instead of the number of lots actually traded.

LotSizeMultiplier

Ignored if UseFixedLotSize is turned on (i.e. non-zero). Otherwise, modifies the message so that the EA reports this multiple of the actual lot size (e.g. 0.1 to divide lot sizes by 10).

SymbolMultipliers

If not blank, a comma-separated list of multipliers for individual symbols which override the main LotSizeMultiplier setting. The symbol names in this list should exactly match the names on the sender account including any suffix used by the broker. For example: GBPUSD=2,USDCHF=0.5

BroadcastAllOrdersAtMarket

If turned on, the Receiver EA is instructed to buy/sell at the current market price, regardless of the entry price for the sender's position. Equivalent to the Receiver EA turning on the TradeAllOrdersAtMarket setting in the receiving EA.

HideSLandTP

If turned on, the s/l and t/p on trades are not broadcast to the Receiver EA.

AddPipsToSL

Hides the true s/l on each trade by adding this number of pips to it (i.e. moving it further away from the open price). This setting is ignored if HideSLandTP is turned on.

AddPipsToTP

Hides the true t/p on each trade by adding this number of pips to it (i.e. moving it further away from the open price). This setting is ignored if HideSLandTP is turned on.

4.1.4Sender parameters: broadcast settings

Broadcast settings

RetryAttempts

Number of times to retry if unable to send an order open/close message. (Not used with "heartbeat" messages because they are quickly resent anyway.)

FuturesSymbol

Symbol used by the broker as a prefix for futures. Can be ignored if you do not intend to trade/broadcast futures. The prefix is typically # for the small number of MT4 brokers who offer futures.

4.1.5Sender parameters: alert and warning settings

Warnings

UserDescription

Controls the description which is displayed in the top-right of the chart, making it easier to distinguish between multiple copies of the EA with different settings. (This setting has no effect on trading behaviour.)

BackgroundColour

Chart background colour which the EA uses. This can be altered to make it easier to distinguish between multiple copies of the EA with different settings.

LabelColour

Colour of the EA's text labels (may need to be changed if you alter the background colour)

SendWarningsByEmail

Any issues which require user attention are always displayed on screen. If this setting is turned on, they are also sent by email (using the details configured in MT4's Tools/Options/Email)

WarningEmailSubjectLine

If SendWarningsByEmail is turned on, the subject line to use for any warning emails

4.1.6Sender parameters: advanced settings

Advanced settings

TradeWatchFrequencyMS

Controls how often the sender checks to see if a new order has been opened, or if an order has been closed. The figure is in milliseconds, and can be set as low as 10. However, values below 25 will typically cause MT4 to start using large amounts of processor power without any real improvement in trade placement. The median delay in the sender spotting a new trade will be half the value of this parameter; a value of 50 will typically lead to new trades being detected after 25 milliseconds.

SendOrderComments

If turned off, then this prevents the EA from sending the comment for each order to the Receiver EA. In effect, it will turn off the UseOriginalOrderComments parameter in the Receiver EA.

5.1Overview of common problems

If either your Sender EA or a subscriber's Receiver EA is unable to connect to the FX Blue hub then it will display a communication error message and number on its chart.

If both the Sender EA and a Receiver EA are successfully connected, then the Sender should be issuing heartbeat messages and the Receiver should be displaying the last-heartbeat time on its chart. If the time is not shown on the Receiver, or is not updating, then please check for communication errors. Please also check that your Sender and subscribers' Receivers are using the same message hub.

If the Receiver is successfully displaying a heartbeat, but no trades are copied, then please see the diagnostic information in the Receiver user guide.

5.2Communication error messages

The following list shows possible error messages which the Sender and Receiver EAs can display in their status indicator on the chart, and whether each message can apply to senders or receivers (or both).

Error #

Sender

Receiver

Meaning

1

Y

Y

Microsoft WinHttp error. Either the Microsoft WinHttp library is missing or damaged, or the computer is critically low on resources such as free memory

2 - 4

Y

Y

Failed to connect to the FX Blue message hub - check your internet connection and proxy server settings

5 - 11

Y

Y

No response from the FX Blue message hub - check the reliability of your internet connection

12

N

Y

You are already using the same receiver details in another copy of the receiver EA

13 - 14

Y

Y

Corrupt response from the FX Blue message hub - check the reliability of your internet connection

1002

Y

N

Your FX Blue account is inactive, and is no longer allowed to send messages through the Trade Mirror

1003

Y

N

You have not set up any subscribers

1004

Y

N

Your FX Blue account is configured to receive signals from one or more users, and cannot also be used as a sending account

1005

N

Y

Your FX Blue account is inactive, and is no longer allowed to receive messages through the Trade Mirror

2000

Y

Y

The copy of the sender/receiver EA is out of date - you need a new version of the software

2002

N

Y

Your FX Blue account has not been set up as a subscriber for the specified sender (or has been removed from the subscriber list)

2003

Y

Y

Incorrect FX Blue password

2004

N

Y

There are too many users already connected to the sender's trades

2005

N

Y

Your FX Blue account is already being used on another computer to receive trades from this sender

2006

Y

Y

Your computer has been blacklisted because of abuse

2007

Y

Y

The sender's FX Blue account has been disabled from using the Trade Mirror

2008

Y

Y

You may need to verify your email address with FX Blue before you can send/receive signals. Please go to http://www.fxblue.com/validate/email.aspx

2009

Y

Y

You may need to verify your phone number with FX Blue before you can send/receive signals. Please go to http://www.fxblue.com/validate/phone.aspx

5.3MT4 error messages

For information about MT4 error messages recorded in the MT4 Experts or Journal log - e.g. error #130, #128, #146 - please see the user guide for the Receiver EA.