You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Designing a Multi-EA Communication Bus Using Named Pipes in MQL5.
This article implements a typed message bus over Windows named pipes to replace MetaTrader's untyped GlobalVariables for inter‑EA communication. A broker EA manages the server and registry, serves multiple slave EAs, and responds with a live, per‑symbol‑attributed portfolio risk measure. It also explains the non-blocking accept pattern that preserves terminal responsiveness, and includes a dashboard and a test script.
If you run multiple Expert Advisors in one terminal, they do not share state by default. Each keeps its own view of the account, and none can see what the others have already worked out. MetaTrader effectively shares only the GlobalVariables namespace. It becomes hard to manage quickly: values are untyped (double), keys are strings with no schema, and stale values are indistinguishable from current ones.
Named pipes solve a narrower, better-defined problem. A named pipe is an OS-level channel that two processes use to exchange bytes, with message framing built in. Instead of encoding meaning into a key, the meaning lives in code: a typed message with an explicit type field and a fixed layout both ends agree on.
This article builds a message bus on that idea. A broker EA owns a named pipe server and a message registry. Three slave EAs connect as clients, each reporting its own position state and receiving back a centrally computed portfolio risk figure. A dashboard shows every sender's live status, and a verification script proves the core logic before any of it touches a real pipe. Ten files make up the system: the message type enum, the typed message and its serialization, the server and client wrappers, the registry, the risk aggregator, the dashboard, the two EAs, and the test script.
Author: Ushana Kevin Iorkumbul