Leader Follower Stop Coordinator
Correlated symbols usually have one that moves first. A EURUSD break often drags GBPUSD and EURJPY along a few ticks or minutes later, and by the time a follower's own stop would react on its own terms, the move that started it is already visible on the leader. This EA reads the leader symbol's own price structure: the highest high and lowest low of a lookback window, measured on the bar BEFORE the potential break bar so a strong breakout cannot mask itself out of its own reference range. When the leader's last closed bar closes beyond that range, every open follower-symbol position facing the threatened direction - longs on a break down, shorts on a break up - has its stop tightened by a configurable factor of its current distance to price. The naive version of this idea invents a brand-new stop out of thin air for every position. This one refuses to do that: a position with no stop already set is left alone and logged, because guessing a first stop is a different tool's job, and a coordinator that quietly adds risk management nobody asked for is worse than one that does nothing on that ticket. It also only ever shrinks a stop distance, never widens one, and respects the broker's minimum stop/freeze distance before sending any modification. Notes and limitations - Only tightens stops that already exist. A follower position with no stop set is skipped and logged, not given a fresh one. - Structure is evaluated on the leader's closed bars only, once per new bar - it does not react tick-by-tick to an in-progress leader candle. - "Leader" and "follower" are configured by the user, not discovered statistically - the tool trusts the correlation the user has already identified, it does not measure it. - Tightening is a one-shot response to each new structure break; it does not keep progressively trailing a stop between breaks.
Expert advisor · MT5 · v1.0 · Free
About Leader Follower Stop Coordinator
Leader Follower Stop Coordinator is an expert advisor (trading robot) for MetaTrader 5. It has a news filter. It has 9 settings, such as Leader symbol, Follower symbols and Timeframe. MQL source code included.
Files in the download: LeaderFollowerStopCoordinator.ex5, LeaderFollowerStopCoordinator.mq5, LeaderFollowerStopCoordinator.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 |
|---|---|---|
| Leader symbol | EURUSD | Symbol whose structure break drives the coordination |
| Follower symbols | GBPUSD,EURJPY | Comma-separated follower symbols to protect |
| Timeframe | PERIOD_H1 | Timeframe the leader's structure is measured on |
| Lookback bars | 20 | Bars used to define the leader's prior high/low structure |
| Tighten factor | 0.5 | New stop distance = old distance * this factor (0-1, smaller = tighter) |
| Magic filter | -1 | Magic number to manage on followers; -1 manages every magic |
| Max retries | 5 | PositionModify attempts before giving up on one ticket |
| Retry wait ms | 500 | Pause between retry attempts, milliseconds |
| Dry run | false | true = log what would tighten, never actually modifies |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Experts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 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: EURUSD · GBPUSD · News Trading · MT5 Expert Advisor · MQL5 Source Code