Cloud based trade copying

MQL5 Experts Scripts

Specification

Based on (https://www.fxblue.com/appstore/u4/internet-trade-mirror-sender/user-guide

It needs to send trades from a master to a server that sends the trades to slave(s)

I need to be able to link different masters to different slaves

If a slave losses/gains too much money either in a day or overall i want it to stop copying it's master (i will set these parameters)

I need it to send trade history to the server 



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/5. 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

Once a receiver gets a signal from your sender, it should make a request to its own broker almost immediately. The speed of trade copying on the receiver is controlled almost entirely by the speed of trade placement by the broker (including network latency to the broker), not by the internal speed of the copier.

The copier's logs will show where any delays are occurring. The copier will record the following process:

Message arriving in the receiver from your sender

Instruction by the receiver to its broker

Confirmation of the new trade on the receiver by the broker

However, there is a special consideration in MT4 (only, not in MT5). Unless your subscribers use the optional Receiver-Worker EA, MT4 can only carry out one trading action at a time, and the receiver EA cannot do anything else while it is waiting for the broker to accept or reject an instruction. If two new signals arrive in the MT4 receiver simultaneously, the receiver EA cannot start working on the second one until its broker accepts/rejects the first one.

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.1.3Slippage tolerance on the receiver

By default, there is a limit on the price difference which the Receiver EA will accept between your sender's price versus the receiver's price - controlled by the AllowSlippagePips setting.

If the price difference between your sender and the receiver is larger than this, the receiver will try to get your sender's price by placing a pending limit order instead of buying or selling at market. Note: the broker can have a restriction on the minimum distance between a pending entry and the current market price. A trade can be rejected (MT4 error #130) if the price difference is larger than AllowSlippagePips but smaller than the broker's stop-level.

You can turn off the slippage check by turning on the setting BroadcastAllOrdersAtMarket. This tells receivers to copy your trades regardless of any price difference.

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/5 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 your sender's copy of MT4/5 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 your 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

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

Symbol names are not standardised and can vary between broker accounts. For example, the EUR/USD fx pair may be EURUSD on one account and EURUSD.xyz on another. An equity index such as the DAX may be referred to as DE30, GER30, .DAX, .DE30, [GER30] etc.

In addition, some accounts may contain more than one version of each market on their symbol list - for example, both EURUSD and EURUSD+. When it receives a trade for EUR/USD, the copier needs to know which symbol it should use - and which version, if there is more than one.

The Receiver EA should almost always be able to handle fx pairs without manual overrides to its settings

The Receiver EA will often be able to handle metals, oil, and equity indices, but may require manual overrides to its settings

Other markets, particularly individual equities such as Apple or Google, will almost always require manual overrides to the Receiver EA settings

3.6Market execution

(Legacy information: some brokers use "market execution" where, in the past, it was necessary for an EA to send a trade and then send a separate instruction to add any s/l and t/p. However, in all recent releases of MT4 and MT5, EAs should now be allowed to send the s/l and t/p as part of their order-open. As a result, the old CloseOrdersImmediatelyIfSLFails setting has been removed from the copier.)

3.7Hedging vs. non-hedging

The copier can be used with both hedging and netting accounts on MT5. However, netting accounts require an extra setting to be turned on in the copier.

The copier cannot be fully used with FIFO/non-hedging accounts on MT4, because MT4 does not have proper netting accounts. If your sender opens a buy ticket and then a sell ticket (or vice versa), the first trade will be successfully copied on a FIFO/non-hedging account but the hedged trade will fail.

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 EAs are capable of handling partial closes.

However, this relies on brokers using the standard functionality of MT4/5. Partial closes will not be processed properly by the copier if the broker deviates from standard MT4/5 functionality:

On MT4, the copier expects a partial close to be identified by the order comment (e.g. "from #12345678")

On MT5, the copier expects the ticket number of a position to be unchanged following a partial close (i.e. ticket number remains the same, with reduced volume).

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/5 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/5's MQL\files directory). If this file is deleted - or is unavailable for some other reason, e.g. because the subscriber is starting up MT4/5 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/5 Global Variables

You can block the Sender from placing new trades using a Global Variable in MT4/5 (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.


Responded

1
Developer 1
Rating
(46)
Projects
60
45%
Arbitration
8
50% / 38%
Overdue
7
12%
Free
2
Developer 2
Rating
(15)
Projects
34
24%
Arbitration
4
0% / 50%
Overdue
2
6%
Working
3
Developer 3
Rating
(144)
Projects
199
42%
Arbitration
20
25% / 55%
Overdue
10
5%
Free
4
Developer 4
Rating
(26)
Projects
34
29%
Arbitration
0
Overdue
1
3%
Free
5
Developer 5
Rating
(70)
Projects
91
25%
Arbitration
26
19% / 54%
Overdue
25
27%
Free
6
Developer 6
Rating
(5)
Projects
4
50%
Arbitration
4
0% / 75%
Overdue
0
Free
Similar orders
Overview I need an MT5 Expert Advisor (MQL5) for a mechanical trading system . It is a hedging account and must run as a true 3-position (3-leg) system (3 separate positions), not partial closes. The EA must match my rules exactly and behave consistently in Strategy Tester and live charts (bar-close signal logic, no forward-looking). Timeframe / Execution Signal timeframe: input All signals are evaluated on
strategy is as follows market gold, timeframe 1 hour. for buys once a candlestick closes 10 pips or lower away from candlestick high. for sells once a candlestick closes 10 pips or lower away from candlestick low, the stop loss is 100 pips and he take profit is two things one 500 pips or for buys once candlestick closes 10 pips or lower away from low of candle stick, and sells once candlestick closes 10 pips or lower
New EA Urgent! 30+ USD
greetings,i am currently looking for a good programmer to help me develop a custom ea using a custom indicator,the strategy will be based on currency correlation,the ea should also have a break even stop loss...thank you
Hi There, I have an indicator which i am using to take trades manually and looking to automate trades through EA. Reach out to discuss further on this work. Cheers
We are looking to acquire an existing, profitable EA that trades using price action–based logic . The EA must operate as a day-trading system with proper Stop Loss and Take Profit , and must NOT use grid, martingale, or high-frequency scalping . This is a buyout request — we want to purchase the complete strategy along with the full source code . We are not looking to develop a new EA from scratch
Build a low-latency, event-driven trading bot for Polymarket esports markets that ingests real-time PandaScore LoL match events , converts them into dynamic win-probability estimates , detects micro-latency mispricing opportunities , and executes short-hold automated trades , with an architecture designed to scale later to Dota 2 and CS2
Hola, Necesito un EA o sistema que me permita copiar operaciones de una cuenta de origen (demo, inversor o real) a una cuenta real , con ciertas reglas específicas que detallo a continuación: Requisitos Tipo de órdenes: La cuenta de origen puede abrir operaciones como Buy Stop o Sell Stop , pero en la cuenta real quiero que se abran órdenes de mercado al instante , tan pronto la operación se activa en la cuenta de
I will develop a custom MetaTrader 5 Expert Advisor based on the client’s provided trading rules. The EA will include proper entry and exit logic, stop loss and take profit handling and stable risk management. The code will be clean, non-repainting, MT5 compliant, and delivered with full source files. "Risk Disclosure : Trading in financial markets involves risk, and results depend on market conditions, broker
I'm looking for someone who can create a EA for an existing MT5 indicator. The goal is to have the EA execute orders when the indicator gives a signal. I already have the SC to the indicator. I would prefer an EA that can be added to the existing Indicator. Message me for more details
I need a professional developer to build a Telegram-to-MetaTrader trade copier system. Project overview: - A Telegram bot will read trade signals from a Telegram channel - Trades will be automatically executed on MT4 and/or MT5 accounts - The system must support copying trades to multiple MetaTrader accounts - Execution should work even when the user is offline Functional requirements: - Structured signal format

Project information

Budget
150+ USD