Skip to content
All library documents

Streaming MetaTrader 5 Trade Signals to MetaTrader 4 Clients

Article MQL5 articles

Summary

This article describes a prototype for forwarding trading activity from a MetaTrader 5 account to MetaTrader 4 clients. It proposes monitoring trade events on the source terminal, selecting deals as the main event record, and distributing those events through a TCP socket server implemented with a C# library. A script on each MetaTrader 4 client maintains a connection and processes incoming messages to reproduce trades, including attempts to reconcile volume when closing positions.

The author favors deal records for their entry-type information, while noting that they do not convey pending orders as directly as order records; using deals may also introduce delay. The prototype is described as working in the author's tests, including a week-long follow of a championship account, but the article provides no systematic performance or reliability evaluation. It acknowledges that the protocol, communication, and execution logic need improvement, and broker price differences can affect copied pending orders and results.

Key ideas

  • A MetaTrader 5 expert advisor can monitor account trade events and distribute them to connected clients.
  • The prototype uses deal history to identify trade actions, trading some immediacy for clearer event information.
  • A TCP server built with a C# library provides a way to broadcast messages to multiple MetaTrader 4 clients.
  • The receiving terminal must translate source events into its own orders and handle differences in available volume.
  • Broker pricing, network delay, and the prototype's limited validation can cause copied trades to diverge.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.