Skip to content
All library documents

Building a Signal Copier for MetaTrader 5 Hedging and Netting Accounts

Article MQL5 articles

Summary

This article describes an Expert Advisor that multiplies the volume of deals copied by MetaTrader’s Signals service. It explains how the copier detects completed deals through trade-transaction events, then opens a corresponding position or increases an existing one according to the configured multiplier. The behavior differs between hedging accounts, which can hold separate positions, and netting accounts, which combine volume into one position.

A key implementation concern is identifying service-managed positions through deal identifiers and magic numbers. The article explains that incorrect identifier handling can cause copied positions to be treated as unrelated positions during synchronization, and discusses how the copier should handle provider closures and its own trades. It states that subscriptions require matching position-accounting systems on provider and subscriber accounts. The copier is intended to increase small copied volumes, but the article warns that increasing the multiplier raises risk and that manual trades on the subscribed account can interfere with synchronization. It provides implementation logic rather than evidence of profitability.

Key ideas

  • The copier scales each successfully copied deal by a configurable volume multiplier.
  • Completed deals can be detected through transaction events after they are added to account history.
  • Hedging accounts open separate positions, while netting accounts combine additional volume into an existing position.
  • Magic numbers and position identifiers help distinguish service-managed positions from copier trades.
  • Provider and subscriber accounts must use the same position-accounting system for subscription.
  • Increasing copied volume increases risk, and manual trades can disrupt synchronization.

Tags

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