Xpert Trade Copier
- 유틸리티
-
Ubaldo Barranco Jimenez
I’m a trader and developer focused on building practical tools for MetaTrader 5.
I create Expert Advisors, indicators, trading systems, and custom tools designed to make trading more systematic, efficient, and easier to manage. - 버전: 1.0
Xpert Trade Copier copies open positions from one MetaTrader 5 account to another on the same computer or VPS. Attach it once as Sender on the source account and once as Receiver on the destination account, give both the same channel name, and the Receiver mirrors every position with the lot size, symbol and safety limits you choose. No DLL, no internet connection, no extra program.
It is built around one rule: a trade must never be copied twice. The Sender publishes the full state of its positions, and the Receiver compares that state with what really exists on its own account before it sends any order. Nothing relies on a message arriving exactly once.
HOW IT WORKS
- Open the two terminals on the same Windows computer or VPS (they can belong to different brokers).
- On the source account, attach the tool to any chart and set Role to Sender. Choose a channel name.
- On the destination account, attach the tool to any chart, set Role to Receiver and type the same channel name.
- Open a trade on the source account. The Receiver opens the matching trade, then follows its stop loss, take profit, partial closes and final close.
WHAT IS COPIED
- Opening at market, with the stop loss and take profit of the source trade.
- Changes to stop loss and take profit while the trade is open.
- Partial closes, in the same proportion.
- Closing, once the source position is gone for two consecutive updates (a single empty read never closes your trades).
- Reverse copy (optional): a buy becomes a sell, and the stop loss and take profit swap sides.
NEVER TWICE: HOW DUPLICATES ARE PREVENTED
- The Sender writes a complete snapshot of its positions, not a stream of events. A repeated or lost update cannot open anything twice.
- Every copy carries a tag with the source position number. Before sending an order the Receiver looks for that tag among the real positions of its account.
- A record kept on disk remembers which source positions were already copied, ignored or closed, so a restart does not open them again and a copy you closed by hand is not reopened.
- The intention to open is saved before the order is sent. If the answer is lost, the Receiver looks for the position instead of sending again.
- If the Sender goes silent (terminal closed, connection lost), the Receiver opens and closes nothing and shows SENDER OFFLINE until it returns.
LOT SIZING (RECEIVER)
- Multiplier: the source lots times a factor. 1.0 copies the same lots.
- Fixed lot: always the same size.
- Balance: source lots scaled by the ratio of the two balances.
- Risk percent: the lot that loses the chosen percentage of your balance if the source stop loss is hit, calculated with the broker's own profit function. Without a stop loss on the source trade, nothing is opened in this mode.
Lots are always rounded down to the broker's volume step and never up. If even the minimum lot is larger than the result, the trade is not copied and the panel says why. A cap on the largest lot is available.
A WORKED EXAMPLE
The Receiver account has 5,000 USD and Risk percent is set to 0.5%, which is 25 USD. The source opens a EURUSD buy with the stop loss 25 pips away. One lot loses about 250 USD over 25 pips, so the Receiver opens 0.10 lots: 25 / 250. With the Balance mode instead, a source account of 10,000 USD that opens 0.20 lots gives 0.20 x 5,000 / 10,000 = 0.10 lots on the Receiver.
SYMBOLS ACROSS BROKERS
- Automatic matching of names with prefixes and suffixes (for example EURUSD.r to EURUSD). A match is accepted only when the base and profit currencies of the two symbols agree, so look-alike symbols are not mixed up.
- A manual map for names that differ completely, for example XAUUSD=GOLD,US30=DJ30.
- Symbol and direction filters on the Receiver; symbol and magic number filters on the Sender.
SAFETY CHECKS BEFORE EVERY ORDER
- Market open for the symbol (waits quietly while it is closed).
- Free margin covers the order (checked with the terminal's margin calculation).
- Volume inside the broker's minimum, maximum and step.
- Stop loss on the right side of the price and not closer than the broker's stops level. A take profit that is too close is moved out to the minimum distance.
- No stop change inside the broker's freeze level.
- Optional limits: largest spread, largest distance from the source entry price, largest number of open copies, largest lot, slippage in points.
- Age limit: a source trade older than 60 seconds is ignored, so starting the Receiver never opens old trades by surprise. A setting lets you copy already open positions too.
- Daily loss guard (optional): when the account loses the chosen percentage of the day's starting balance, every copy is closed and no new copy opens until the next day.
Errors are written in plain words, and expected waits do not flood the Experts journal.
THE PANEL
A compact panel shows the role, a colored status (COPYING, PAUSED, WAITING FOR SENDER, SENDER OFFLINE, DAILY LIMIT REACHED), the source account, the number of source positions and open copies, how many were opened and closed, the sizing mode and the last event. It follows your chart theme, dark or light.
- PAUSE NEW / RESUME stops or resumes opening new copies. Open copies keep following the source.
- CLOSE COPIES closes every copy. It asks for a second click to confirm.
COMPATIBILITY
- MetaTrader 5, Windows. Sender and Receiver terminals on the same computer or VPS. Not for copying over the internet.
- Tested on hedging accounts and on a netting account. On netting accounts the broker merges all orders of a symbol into one position, so the tool follows one source position per symbol at a time. A second source position on a symbol that is already followed is skipped, and the panel says so.
- Tested between two different brokers, with symbols of different names.
- Any symbol, any timeframe. Attach one copy of the tool per role and per account.
- No DLL, no WebRequest, no time or account limits.
- Strategy Tester demonstration: an internal source feed drives the real Receiver code, so it works unattended.
SETTINGS (AS SHOWN IN THE INPUTS TAB)
General
- Role of this chart: Sender (publishes the positions of this account) or Receiver (copies them).
- Channel name: the link between the two sides. Use the same name on the Sender and on every Receiver.
Sender: what to publish
- Publish only these symbols / Publish only these magic numbers: comma lists to publish just part of the account. Empty means everything.
Receiver: lot size
- Lot size mode: Multiplier, Fixed lot, Balance or Risk percent.
- Multiplier: factor for the Multiplier and Balance modes. 1.0 means the same lots.
- Fixed lot: the size used in Fixed lot mode.
- Risk, percent of balance: used in Risk mode.
- Largest lot per copy: an upper limit for any copy. 0 means no limit.
Receiver: what to copy
- Copy only these symbols: copy just these symbols. Empty means all.
- Directions to copy: buys and sells, buys only or sells only.
- Reverse copy: a buy becomes a sell and the stop loss and take profit swap sides.
- Copy the stop loss / Copy the take profit: switch each one on or off.
- Also copy positions already open when starting: by default, positions older than 60 seconds are ignored so that starting the Receiver never opens old trades by surprise.
- Symbol map: pairs such as XAUUSD=GOLD,US30=DJ30 for names that differ completely.
Receiver: safety limits
- Allowed slippage: in points.
- Skip when the spread is above: in points. 0 means off.
- Skip if price differs from source entry: in points. 0 means off.
- Largest number of open copies: 0 means no limit.
- Daily loss limit: percent of the day's starting balance. When it is reached, every copy is closed and no new copy opens until the next day. 0 means off.
Panel
- Show the panel, Panel X, Panel Y: visibility and position in pixels.
Some things are automatic and are not settings: the magic number of the copies (derived from the channel name), the time after which a silent Sender counts as offline (10 seconds), the protection that never republishes a copy as a source trade, and the 60 second age limit.
FREQUENT QUESTIONS
Can it copy to another computer? No. Both terminals must run on the same computer or VPS, because they exchange data through the terminals' shared folder.
Do both accounts need the same broker? No. Symbol names are matched automatically or with your own map.
What happens if I restart the Receiver? It remembers what it already copied. Positions still open keep being followed and nothing is opened twice.
What if the Sender closes? The Receiver keeps its copies, opens and closes nothing, and shows SENDER OFFLINE. When the Sender returns, it continues.
Can I run several Receivers from one Sender? Yes, give each the same channel name.
Why was a trade not copied? The panel shows the last event. Common reasons: older than the age limit, below the minimum lot, not enough margin, price already beyond the source stop loss, on a netting account another source position on the same symbol is already followed.
IMPORTANT TO KNOW
- Enable Algo Trading in the Receiver terminal and allow trading for the tool. The panel tells you when it is off.
- Copies carry a magic number derived from the channel name and a comment that starts with TCL#. Other robots on the Receiver account are never touched.
- Prices and execution differ between brokers, so the copy can differ slightly from the source trade.
- The Sender does not trade; it only reads and publishes its open positions.
NOT INCLUDED
No pending orders (only open positions are copied), no MT4, no copying between different computers, no signals from messaging apps or other services, no scheduled copying, no mobile notifications, no trailing stop or breakeven on the copies, no several Senders into one Receiver, and the commission is not part of the risk calculation. Senders logged in with an investor password were not tested.
RISK DISCLAIMER
Trading foreign exchange, metals, indices, cryptocurrencies and other leveraged financial instruments carries a high level of risk and may not be suitable for everyone. You can lose some or all of your invested capital, so never trade with money you cannot afford to lose.
Xpert Trade Copier is a trade copying tool. It does not provide investment advice, signals or recommendations, and it does not guarantee profits or protect you from losses. Copied trades can differ from the source trades because of slippage, spreads, gaps, requotes, commissions, swaps, different brokers or connection problems, and a copy can lose money even when the source trade wins.
Use the tool responsibly and make your own decisions. Test it on a demo account before using it on a live account. The author is not responsible for any loss or damage arising from its use. You are solely responsible for your trading decisions and results.
Questions or ideas: send me a private message on MQL5.com.
