Local Trade Relay
- 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
Use one desktop terminal to follow selected market positions in another. Attach Local Trade Relay to a chart in each terminal and give the pair a channel name. The sender reads its account. The receiver starts in Preview and shows the symbol, side and lot size it would request. Execution is a separate choice in the receiver inputs.
This edition runs on MT5 hedging accounts that allow individual ticket closes. Install the corresponding MT4 edition for an MT4 endpoint. The two terminals must run on the same computer and reach the same folder. Each channel connects one sender to one receiver.
Quick start
- Attach the edition for each terminal to any chart. Set Local channel to the same name on both, for example desk-a . Use lowercase letters, digits, a hyphen or an underscore.
- Choose Sender on the source chart. Select the source symbols and magic number you want to follow. Manual positions have magic zero and require Include manual.
- Choose Preview receiver on the destination chart. Set any symbol mappings and the lot factor. Watch for Previewing receiver actions and check the proposed symbol, direction and size.
- To try the connection without an account position, enable Example data on both charts. The sender publishes a fictional 0.20-lot EURUSD buy. Add EURUSD=EURUSD.demo and a lot factor of 0.50 on the receiver to see a proposed 0.10-lot buy. The example runs in its own folder and supports Sender and Preview only.
- To follow account positions, switch off Example data on both charts and check Preview on a demo pair. When you choose Execution receiver, enable automated trading in the destination terminal and in the EA properties. A fresh destination quote and a current sender snapshot are required.
Try the Market demo in Strategy Tester
Select Local Trade Relay, enable visual mode and start a test over a period with at least five historical ticks spaced 15 simulated seconds apart. The SAMPLE DATA panel follows a fictional EURUSD position through five snapshots. At a lot factor of 0.50, the receiver previews a 0.20-lot open, updates its protection, reduces 0.10 lots and closes the remaining 0.10 lots after two exit observations. The last screen keeps the totals visible. Run it again with a smaller lot cap or turn off Mirror stops, Follow reductions or Follow closes to see the effect. The walkthrough runs in memory, requires one terminal and submits zero orders.
Inputs
| Input | Effect |
|---|---|
| Role, local channel, example data | Choose Sender, Preview receiver or Execution receiver. A blank channel shows setup instructions. Example data uses fictional positions and quotes. |
| Storage | Common Files is the default for two terminals under one Windows user. For a managed installation, Linked Terminal Files reads the product's folder under each terminal's MQL4/Files or MQL5/Files . Both product folders must already lead to the same private local directory. The folder is LocalTradeRelay for accounts and LocalTradeRelayExamples for examples. |
| Sender symbols, sender magic, include manual | Enter exact names separated by commas, or leave the symbol list empty for all. Magic -1 accepts eligible magic numbers. Manual positions require the separate switch. The reserved receiver magic and positions marked by the relay are excluded. |
| Receiver symbol map | Enter exact pairs such as EURUSD=EURUSD.a,XAUUSD=GOLD . Unlisted names pass through unchanged. Match equivalent contracts, quote currencies and price units before enabling execution. |
| Receiver magic | Reserve one positive magic number on the destination account for this channel. A position with that magic and unclear ownership pauses processing. |
| Lot factor, maximum lots | Multiply source lots by the factor, cap each copied position, then round down to the destination volume step. The defaults are 1.0 and 1.0 lot. |
| Mirror stops | Copy absolute stop-loss and take-profit prices, including removal. Stops round outward to the destination price tick and are checked against its distance rules. |
| Follow reductions, follow closes | Follow partial reductions and confirmed full exits independently. A new open carries its requested protective prices in the same request. |
| Maximum entry age, maximum entry gap | Defaults are 90 seconds and 50 destination points. Positions over either limit wait. Zero disables the corresponding limit. |
| Deviation, stale seconds | Request up to 10 destination points of price deviation by default. Broker execution rules determine the fill. The default snapshot expiry is 8 seconds. |
Examples
- Copy one strategy. On the sender, select magic 77 and symbols EURUSD,GBPUSD . A manual EURUSD position and a position with magic 99 stay outside the channel.
- Reduce at half size. A 0.40-lot source position produces a 0.20-lot target at a 0.50 factor. If the source drops to 0.20 lots, the receiver can reduce its own 0.20 lots to 0.10 lots. The destination must support those sizes.
- Resume after a disconnect. Reattachment reads the saved receiver ledger first. If someone changes the receiver's SL or TP before its previous edit is confirmed, the receiver can still follow a source reduction. A full exit requires two distinct fresh publications confirming the source has disappeared.
Limits and operating notes
- Market buys and sells are supported. Buy Limit, Sell Limit, Buy Stop, Sell Stop, Buy Stop Limit and Sell Stop Limit orders are outside the relay. A filled pending order becomes eligible when it appears as a market position. A position opened and closed between snapshots may never be seen.
- Each source entry opens at most one destination position. If a destination stop or a manual close ends it, the ledger retains that exit while the source is open. Partial fills and manual reductions are never topped up. A positive source remainder smaller than the destination minimum leaves at least one tradable minimum lot when possible.
- The sender verifies disappearing positions using broker history. For MT4 endpoints, a broker may issue a replacement ticket after a partial close. Missing history or an ambiguous replacement pauses the affected flow. Receiving stops and prices can be different across brokers.
- Each snapshot can carry up to 256 eligible positions. If the inventory changes while it is being scanned or exceeds that limit, the sender keeps the last complete publication.
- A timeout or an uncertain broker response holds the recorded request until ownership or completion can be verified. Check the status panel, Experts journal and broker history before intervening. A definite rejection can be retried after 15 seconds while the source remains eligible.
- Keep the channel's ledger, filters, mapping, sizing, magic and management switches with the pair. To change these settings, finish managing its open positions and start a new channel. Keep its folder private and available to both terminals. Unattended monitoring requires both terminals to stay open.
- Paired account copying requires two desktop terminals. This edition supports MT5 hedging accounts with individually closable tickets. The destination broker sets the prices, margin requirements, contract sizes and available volume.
