Loading…

Fan Out Coordinator

A single shared export file forces every slave that reads it to accept the same symbols and the same lot scaling, which is rarely what a real multi-slave setup needs - one slave might only want EURUSD and GBPUSD at half size, another might want everything at full size. This EA solves that on the master side: it parses a semicolon-separated slave configuration list (name, lot ratio, symbol filter) and writes a separate snapshot file per slave, each already scaled and filtered for that specific slave, so the slave-side copier reading it needs no further logic of its own. The coordinator also reads back a heartbeat file each slave is expected to maintain and classifies its health as OK, STALE or DOWN based on how long ago that heartbeat last updated, displayed live on the master chart. A silently disconnected slave is a real operational risk in a fan-out setup - the master has no other way to know a slave stopped reconciling - so this is a genuine visibility feature, not decoration. Notes and limitations - This EA does not transport files between the master and slave terminals - it only writes the per-slave snapshot files into its own MQL4\Files\ (or MQL5\Files\ on the native MQL5 build) sandbox. Moving them to each slave terminal (shared folder, sync tool, remote copy) is outside this project's scope, as is writing the heartbeat files, which is a slave-side responsibility. - A slave with no heartbeat file at all reports "NO HEARTBEAT" rather than OK, STALE or DOWN - that is the honest state for a slave setup that was never wired up to report back, and is not treated as healthy by default. - Up to 20 slaves can be configured (a fixed-size cap, chosen for simple, safe array handling in native MQL4 rather than dynamic growth); a 21st entry in InpSlaveConfig is dropped with a log line. - The per-slave lot ratio is applied once, on export. If a slave-side copier also applies its own ratio, the effective scaling compounds - keep each slave's own copier ratio at 1.0 when using this coordinator's InpSlaveConfig ratio for that slave.

Expert advisor · MT4 · v1.0 · Free

About Fan Out Coordinator

Fan Out Coordinator is a script for MetaTrader 4. It has 4 settings, such as Magic filter, Export interval sec and Heartbeat stale sec. MQL source code included.

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

Settings

SettingDefaultWhat it does
Magic filter0Only export master orders with this magic (0 = export all magics)
Export interval sec3Seconds between snapshot exports
Heartbeat stale sec30A slave with no heartbeat update for this long is marked STALE
Heartbeat down sec120A slave with no heartbeat update for this long is marked DOWN

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 · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria