Loading…

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 · MT4 · v1.0 · Free

About Leader Follower Stop Coordinator

Leader Follower Stop Coordinator is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 9 settings, such as Leader symbol, Follower symbols and Timeframe. MQL source code included.

Files in the download: LeaderFollowerStopCoordinator.ex4, LeaderFollowerStopCoordinator.mq4, LeaderFollowerStopCoordinator.txt.

Settings

SettingDefaultWhat it does
Leader symbolEURUSDSymbol whose structure break drives the coordination
Follower symbolsGBPUSD,EURJPYComma-separated follower symbols to protect
TimeframePERIOD_H1Timeframe the leader's structure is measured on
Lookback bars20Bars used to define the leader's prior high/low structure
Tighten factor0.5New stop distance = old distance * this factor (0-1, smaller = tighter)
Magic filter-1Magic number to manage on followers; -1 manages every magic
Max retries5OrderModify attempts before giving up on one ticket
Retry wait ms500Pause between retry attempts, milliseconds
Dry runfalsetrue = log what would tighten, never actually modifies

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: EURUSD · GBPUSD · Alerts · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria