Local Trade Copier Slave
This is the acting half of a local trade copier; it does nothing without Local Trade Copier Master running on another account and writing to the same channel. Once it finds that shared file, it opens the same direction the master opened, at a volume you control independently, closes the mirror the instant the master's order closes, and can optionally follow live stop loss and take profit changes too. Reverse Copier, also in this catalogue, reads the identical file and does the opposite - opens the reverse side as a hedge - if mirroring in the same direction is not what you are looking for. The two accounts read and are usually on different brokers with different quotes, which is why stop loss and take profit are never copied as raw prices - the same price sits a different distance from two different entries. Instead this EA reads the master's stop distance in pips from its own entry, and re-applies that same pip distance from the slave's own entry. A stop 20 pips behind the master's entry becomes a stop 20 pips behind the slave's entry, wherever that lands on this broker's own price scale. Bookkeeping is deliberately stateless rather than kept in an in-memory map. Every order this EA opens is tagged with its own magic number and a comment carrying the master's ticket, and on every timer tick it re-reads its own open orders by that magic and comment to find which mirror belongs to which master ticket, rather than trusting memory that a restart would lose. An EA restart or terminal recompile never loses track of an open mirror because of it. See Local Trade Copier Master's description for why the shared file lives in Common\Files rather than the usual per-terminal sandbox, and for the same-PC limitation that follows from it. Notes and limitations - Same PC only, via Common\Files - see Local Trade Copier Master's notes. This does not copy trades across the internet or between two different machines. - On a NETTING slave account, a second concurrent master ticket on a symbol that already has an open mirror is skipped, not merged - see MQL4 VERSUS MQL5 DIFFERENCES above. This is specific to the MQL5 build; the MQL4 build has no such restriction because MQL4 accounts are always hedging. - A symbol the master trades but this account does not offer is skipped and logged, not substituted or approximated onto a similar symbol. - Stop loss and take profit are translated by pip distance from each account's own entry price, not copied as raw prices - correct for different brokers on different quotes, but it means the slave's stop can sit at a genuinely different price level than the master's, by design. - Removing this EA from the chart, or the terminal closing, leaves any open mirror positions exactly as they are. It never closes a mirror on its own removal - only a matching close event read from the master's file does that. - If the master account is itself risky - a discretionary trader having a bad session, a strategy with an unbounded stop - every one of those trades is mirrored here at whatever volume InpLotMode produces. This EA has no independent risk control of its own; it trusts the master's trading decisions entirely. - If AutoTrading is off on this account, mirrors cannot be opened or closed; the EA logs this and otherwise does nothing until it is re-enabled.
Expert advisor · MT4 · v1.0 · Free
About Local Trade Copier Slave
Local Trade Copier Slave is an expert advisor (trading robot) for MetaTrader 4. It has 10 settings, such as Channel name, Lot mode and Lot ratio. MQL source code included.
Files in the download: CopierSlave.ex4, CopierSlave.mq4, CopierSlave.txt.
Trading robots can lose money. Check every setting and test on a demo account before using real funds.
Settings
| Setting | Default | What it does |
|---|---|---|
| Channel name | default | Channel name (must match the master's input) |
| Lot mode | LOT_RATIO | How the mirrored volume is sized |
| Lot ratio | 1.0 | Used when Lot mode = Ratio |
| Fixed lot | 0.01 | Used when Lot mode = Fixed |
| Magic | 900001 | Magic number this EA tags its own orders with |
| Mirror sl tp | true | Copy stop loss / take profit changes too |
| Max file age sec | 30 | Treat the file as stale beyond this age |
| Slippage pips | 3 | Slippage tolerance, in pips |
| Max retries | 5 | Attempts per order before giving up |
| Retry wait ms | 500 | Pause between attempts, milliseconds |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Experts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
- Test it first on a demo account or in the Strategy Tester.
Tags: Volume · Channels & Envelopes · Trade Copier · MT4 Expert Advisor · MQL4 Source Code