Local Trade Relay MT4
- Utilità
-
Kim Seongyu
I approach investing by asking what drives an investment’s return, what could undermine it, and what evidence would change my view. - Versione: 1.2
- Aggiornato: 24 novembre 2026
- Attivazioni: 5
Overview
Follow selected market trades from one desktop terminal in another. Local Trade Relay can read an MT4 source account or serve as its destination. Each chart shows its role, the channel status and the positions it is publishing or would act on. Preview is the default receiver mode.
Use this edition at an MT4 endpoint. For a pair containing MT5, install the MT5 edition at that endpoint and select a hedging account that allows individual ticket closes. Both terminals run on the same computer.
Quick start
- Attach the EA to any chart in each terminal. Enter the same local channel, for example london-a . A channel takes lowercase letters, digits, a hyphen and an underscore.
- On the source chart, select Sender. Choose the source symbols and strategy magic number. Leave Include manual off unless trades opened by hand should also be eligible.
- Select Preview receiver on the other account. Reserve a receiver magic number, set the lot factor, and map broker suffixes. Check the action shown on the chart.
- For a walkthrough, enable Example data at both ends. With EURUSD=EURUSD.demo and a 0.50 lot factor, the receiver previews a 0.10-lot buy from a fictional 0.20-lot EURUSD source trade. This walkthrough uses a separate folder and fictional quotes.
- With Example data off, review your account pair first in Preview. Choose Execution receiver and enable AutoTrading and Allow live trading on the destination when you want orders submitted.
Try the single-terminal tester
Select the EA in Strategy Tester, tick Visual mode, and run a date range with at least five historical ticks spaced 15 simulated seconds apart. The SAMPLE DATA chart shows a fictional 0.40-lot EURUSD buy, a change in SL and TP, a reduction to 0.20 source lots, and two snapshots confirming the source exit. Set Lot factor to 0.50 to watch the virtual receiver open 0.20 lots, reduce 0.10 and close 0.10. The final panel retains the quantities. Changing the lot cap or management switches changes the walkthrough. All example state stays in memory and the tester submits zero orders.
Inputs
| Input | Use |
|---|---|
| Role, channel, example data | Pair one Sender with one Preview or Execution receiver. Give the channel a name to begin. Example data permits Sender and Preview roles. |
| Storage | Choose Common Files for terminals under one Windows user. Linked Terminal Files is available where the administrator has connected the product folder in each terminal's Files directory to the same private local directory. Use LocalTradeRelay for account data or LocalTradeRelayExamples for the walkthrough. |
| Source symbols, source magic, include manual | Supply a comma-separated list of exact symbols or leave it empty for all. Source magic -1 accepts eligible strategy numbers. Magic zero also needs the manual switch. Trades marked by the relay and the reserved magic are excluded. |
| Receiver symbol map | Write exact pairs such as EURUSD=EURUSDm,GBPUSD=GBPUSDm . Unlisted symbols retain their name. Map contracts with matching price units and verify contract size. |
| Receiver magic | Reserve a positive magic value for the pair on the destination account. Unrelated manual trades and other magic numbers stay outside its management. |
| Lot factor, maximum lots | Multiply source volume, apply the per-position cap, then round down to the broker's lot increment. Both defaults are 1.0. An opening size below the broker minimum is held. |
| Mirror stops | Mirror absolute SL and TP, including removal, using the destination tick size and stop-distance rules. An opening request includes the requested protective prices. |
| Follow reductions, follow closes | Choose whether to follow partial reductions and verified source exits. A positive source remainder is kept at the minimum tradable destination size when necessary. |
| Maximum entry age, maximum entry gap | Defaults are 90 seconds and 50 destination points. Set an individual limit to zero to disable it. Entry checks are independent of later exit management. |
| Deviation, stale seconds | The requested execution deviation defaults to 10 destination points. The broker determines execution. A source snapshot expires after 8 seconds by default. |
Examples
- Copy a manual position. Use magic zero and enable Include manual. Set EURUSD in the source symbol list to keep manual trades in other instruments outside the pair.
- Match different broker names. Map EURUSD=EURUSDm on the receiver. A 0.35-lot source entry at a 0.50 factor becomes 0.17 lots on a 0.01 grid. The next source SL change applies to that matched ticket.
- Watch an MT4 partial close. Some servers retain the ticket and others issue a smaller replacement. If several partial closes happen between updates, the relay follows linked tickets in broker history to the remaining trade or its verified final exit. It pauses when ownership cannot be established.
Limits and operating notes
- MT4 pending Buy Limit, Sell Limit, Buy Stop and Sell Stop orders are excluded. MT5 Buy Stop Limit and Sell Stop Limit orders are also excluded from mixed pairs. Once a pending order fills, its market position can be observed. A trade that opens and closes between publications can be missed.
- This version supports separately closable market tickets. FIFO restrictions, destination netting, remote computers and multiple senders or receivers on one channel are outside scope. A paired account session requires two terminals.
- A stale heartbeat or disconnected terminal holds existing copies. The receiver can follow a reduction after a separate SL or TP edit, even across a restart. A full source exit needs two distinct fresh publications. A broker timeout or unclear ticket blocks a duplicate submission. Pending confirmations appear on the chart and broker return codes appear in Experts.
- A snapshot carries up to 256 eligible market trades. When the sender cannot verify the whole inventory, the previous complete snapshot remains in place until it expires.
- A destination position closed by hand, SL or TP stays closed while its source ticket remains open. Partial opening fills and manual reductions are never topped up. A definite rejection may retry after 15 seconds while the trade is eligible.
- Keep sufficient MT4 account history available for ticket matching. Keep the receiver's ledger in place across restarts, reserve its magic exclusively, and retain the pair's filters, mapping, sizing and management switches. Finish open positions and start a new channel to change those settings. Both terminals and the shared private folder must remain available.
