Trade Copy

1
Overview

  Copy trades to other accounts.

Operating environment

  Source and destination MT4

Operating conditions

  Source and destination are on the same PC.
  Source and destination are 1: Multiple.

Detailed specifications

  Copy target

    New order
      Market / SL / TP

    Change orders
      SL/TP

    Settlement orders
      Destination orders that are not in the source are closed.
      (Market / SL / TP)

    Magic number
      Specified magic number(s).

    Ignores trade orders that have been delayed in processing.
      If a delay occurs between the source and destination EAs,
      Sets whether the trade is copied or not.
      Set the acceptable delay in milliseconds (ms).

    Ignore past trade orders
      If the PC or this system is restarted for any reason,
      Sets whether trades should be copied back in the past.
      Set the past to go back in seconds (s).

  Action to copy to

    Magic number
      Operates with the magic number you set.

    User intervention
      The settlement order of the copy destination is not copied again.
      The change order of the copy destination is changed to the content of the original order. (revert).
      New orders at the destination are closed as they are not in the source. (Not applicable if the magic number is different)

    Lot number
      The number of lots is calculated as the ratio of the source and destination balances.
      In addition, it is recalculated using the conversion ratio parameter.

  Operation in the event of an error (or until both the source and destination EAs have been activated)

    Copy source stops
      Copying (new/change/close) according to the copy source in real-time is not possible.

    Recovery after copy source is stopped.
      New orders are copied according to the ‘Ignore past trade orders’ parameter.
      Copy past change orders.
      Copy past settlement orders.

    Copy source stopped
      Copying (new/change/close) according to the source in real-time is not possible.

    Recovery after copy destination has been suspended
      Copy past new orders according to the parameter ‘Ignore past trade orders’.
      Copy past change orders.
      Copy past close orders.

    PC or MT4 is slow
      Delayed new orders are copied according to the ‘Ignore delayed trade orders’ parameter.
      Copy delayed change orders.
      Copy delayed close orders.

Activation procedure

  There is no order in which the source and destination are activated.

Mechanism

  Data is exchanged in ‘Common\Files’.


I created a trade copy tool, but a good free one was released by FX Blue and others.

I reworked it to my specifications from the published source code.
The source code is attached. Feel free to use it.

I translated it from Japanese to English, but I have not translated it from English to Japanese and checked it for proper text.I'm sorry.
These users thanked the author funchi for the post (total 9):
ChuChu Rocket, Jackson Doh, rsistoch, global, eduarescobar, KaMAngo1873, Jimmy, asgariHoo, Akela

Re: Trade Copy

2
funchi wrote: Sat May 10, 2025 10:35 am Overview

  Copy trades to other accounts.

Operating environment

  Source and destination MT4

Operating conditions

  Source and destination are on the same PC.
  Source and destination are 1: Multiple.

Detailed specifications

  Copy target

    New order
      Market / SL / TP

    Change orders
      SL/TP

    Settlement orders
      Destination orders that are not in the source are closed.
      (Market / SL / TP)

    Magic number
      Specified magic number(s).

    Ignores trade orders that have been delayed in processing.
      If a delay occurs between the source and destination EAs,
      Sets whether the trade is copied or not.
      Set the acceptable delay in milliseconds (ms).

    Ignore past trade orders
      If the PC or this system is restarted for any reason,
      Sets whether trades should be copied back in the past.
      Set the past to go back in seconds (s).

  Action to copy to

    Magic number
      Operates with the magic number you set.

    User intervention
      The settlement order of the copy destination is not copied again.
      The change order of the copy destination is changed to the content of the original order. (revert).
      New orders at the destination are closed as they are not in the source. (Not applicable if the magic number is different)

    Lot number
      The number of lots is calculated as the ratio of the source and destination balances.
      In addition, it is recalculated using the conversion ratio parameter.

  Operation in the event of an error (or until both the source and destination EAs have been activated)

    Copy source stops
      Copying (new/change/close) according to the copy source in real-time is not possible.

    Recovery after copy source is stopped.
      New orders are copied according to the ‘Ignore past trade orders’ parameter.
      Copy past change orders.
      Copy past settlement orders.

    Copy source stopped
      Copying (new/change/close) according to the source in real-time is not possible.

    Recovery after copy destination has been suspended
      Copy past new orders according to the parameter ‘Ignore past trade orders’.
      Copy past change orders.
      Copy past close orders.

    PC or MT4 is slow
      Delayed new orders are copied according to the ‘Ignore delayed trade orders’ parameter.
      Copy delayed change orders.
      Copy delayed close orders.

Activation procedure

  There is no order in which the source and destination are activated.

Mechanism

  Data is exchanged in ‘Common\Files’.


I created a trade copy tool, but a good free one was released by FX Blue and others.

I reworked it to my specifications from the published source code.
The source code is attached. Feel free to use it.

I translated it from Japanese to English, but I have not translated it from English to Japanese and checked it for proper text.I'm sorry.
Hi Mr Funchi.
Would I request for MT5? Thanks.

Re: Trade Copy

3
asgariHoo wrote: Thu Feb 05, 2026 2:23 am Hi Mr Funchi.
Would I request for MT5? Thanks.
There appear to be better trade copy tools available for free.
Therefore, development has been discontinued and the MT4 source code has been made public.

There is no development planned for MT5.
These users thanked the author funchi for the post:
asgariHoo

Re: Trade Copy

4
asgariHoo wrote: Thu Feb 05, 2026 2:23 am Hi Mr Funchi.
Would I request for MT5? Thanks.
As I now need one myself, I started developing an MT5 version.

I looked at some other free trade-copying tools, but none of them were quite right for me.
In particular, I don't trust software on Windows that relies on an installer.
So I decided to build my own.

It is currently undergoing testing.

Although this differs from the MT4 documentation, MT5 behaves in the same way as MT4.
  • Overview
      Copies trades from one account to another.
  • Operating Environment
      Runs on MT5.
  • Functional Overview
      The source EA and destination EA are linked using the "Pairing ID" parameter.
      Trades from a single source account can be copied to multiple destination accounts.
      The source EA allows multiple Magic Numbers to be specified for copying.
  • Operating Conditions / Limitations
      Only supported within the same PC.
      Only supported between MT5 terminals.
      Only Hedging mode is supported. Netting mode is not supported.
      Only market orders are supported. Pending orders are not supported.
      Multiple instances using the same Pairing ID cannot run within a single account.
  • Detailed Specifications
      Copy Operations
        New Orders
          Copies market orders, including SL and TP.

        Modified Orders
          Updates SL and TP.

        Closed Orders
          Any copied trade that exists on the destination account but no longer exists on the source account will be closed.

        Magic Numbers
          Only the Magic Numbers specified in the parameters are copied.
          Multiple Magic Numbers can be configured.

        Ignore Delayed Trade Orders
          If a delay occurs between the source EA and the destination EA, you can choose whether delayed trades should be copied.
          The maximum acceptable delay is specified in milliseconds (ms).

        Ignore Past Trade Orders
          If the PC or this system is restarted for any reason, you can choose whether historical trades should be copied.
          The historical look-back period is specified in seconds (s).

      Destination EA Behaviour
        Magic Number
          The destination EA operates using the configured Magic Number.

        User Intervention
          If a copied position is manually closed on the destination account,
          it will remain closed and will not be copied again.
          If a copied position is manually modified on the destination account,
          its settings will be restored to match the source account.
          If a new position is opened manually on the destination account,
          it will be closed because it does not exist on the source account. (This does not apply if it uses a different Magic Number.)

        Lot Size
          The default lot size is calculated according to the balance ratio between the source and destination accounts.
          The result is then adjusted using the configured lot conversion ratio parameter.

      Behaviour During Abnormal Conditions
      (or until both the source and destination EAs have fully started)
        Source EA Stopped
          Real-time copying (new orders, modifications, and closures) cannot be performed while the source EA is stopped.

        Source EA Restarted
          Historical new orders are copied according to the "Ignore past trade orders" parameter.
          Historical order modifications are copied.
          Historical order closures are copied.

        Destination EA Stopped
          Real-time copying (new orders, modifications, and closures) cannot be performed while the destination EA is stopped.

        Destination EA Restarted
          Historical new orders are copied according to the "Ignore past trade orders" parameter.
          Historical order modifications are copied.
          Historical order closures are copied.

        PC or MT5 Experiences Performance Delays
          Delayed new orders are copied according to the "Ignore delayed trade orders" parameter.
          Delayed order modifications are copied.
          Delayed order closures are copied.
  • Startup Procedure
      There is no required startup order. The source EA and destination EA may be started in any order.
  • How It Works
      The source EA and destination EA exchange data via the MT5 "Common\Files" directory.
      Since MT4 and MT5 use the same file format and data specification, they are theoretically compatible with each other.
      However, this has not yet been verified.
These users thanked the author funchi for the post (total 5):
asgariHoo, kudrpenk, mazibee, eduarescobar, stond

Re: Trade Copy

6
funchi wrote: Mon Jul 20, 2026 3:52 pm This is the latest version.
While I was at it, I also confirmed that copying between MT4 and MT5 works.
MT4 needed a fix.
First of all, thank you very much, Master Funchi, for sharing the updated versions for both MT4 and MT5 Trade Copier.

We are truly fortunate to have you, along with the other experienced coders here at Forex Station, who generously give time and share work with the community.

I'm not a coder or an expert, just someone who enjoys learning.

I use AI mainly to help me understand concepts when I get stuck, especially when the source code is available.

I would be very grateful if you could kindly explain how to use this trade copier.

My intention is to copy trades from an MT4 terminal to an MT5 terminal, but I'm not sure of the correct setup or procedure.

Any guidance or a simple explanation would be greatly appreciated.

Thank you once again, and stay blessed always.
These users thanked the author mazibee for the post:
funchi

Re: Trade Copy

7
Parameter Configuration

  Source (Trade_copy_src) Parameters
  • Pairing ID
    Set the same "Pairing ID" for the Expert Advisors that will copy positions (Trade_copy_src and Trade_copy_des).
    The "Pairing ID" must match between the source (Trade_copy_src) and the destination (Trade_copy_des).
    If you are running multiple instances of this EA, be sure to assign a unique "Pairing ID" to each pair.
  • Synchronisation Interval (ms)
    Specify, in milliseconds (ms), how often the source EA retrieves the current position status and sends it to the destination EA.
  • Operating EA after MT4 start-up
    Specify whether the EA (Trade_copy_src) should start operating automatically when the MT4 terminal is launched or when the EA is attached to a chart.
  • MagicNumbers (1,2 ...) If empty, all
    Specify the Magic Number(s) that Trade_copy_src will copy.
    Multiple Magic Numbers can be specified by separating them with commas.
    If left blank, all Magic Numbers will be copied.
  Destination (Trade_copy_des) Parameters
  • Pairing ID
    Set the same "Pairing ID" for the Expert Advisors that will copy positions (Trade_copy_src and Trade_copy_des).
    The "Pairing ID" must match between the source (Trade_copy_src) and the destination (Trade_copy_des).
    If you are running multiple instances of this EA, be sure to assign a unique "Pairing ID" to each pair.
  • Synchronisation Interval (ms)
    Specify, in milliseconds (ms), how often the destination EA receives the position status from the source EA and places the corresponding orders.
  • Ignore delayed trade orders (ms)
    Specify whether trades should be copied when a delay occurs between the source and destination EAs.
    Set the maximum acceptable delay in milliseconds (ms).
  • Ignore past trade orders (s)
    Specify whether trades that occurred in the past should be copied if the PC or this system is restarted for any reason.
    Set how far back, in seconds (s), the system should look when considering past trades.
  • Trade Copy System MagicNumber
    Specify the Magic Number to be assigned to orders placed on the destination terminal.
  • Operating EA after MT4 start-up
    Specify whether the EA should start operating automatically when the MT4 terminal is launched or when the EA is attached to a chart.
  • Symbol Convert (src=des, src=des ...)
    Use this parameter if the symbol names differ between the source and destination terminals.
    Multiple symbol mappings can be specified by separating them with commas.
    Example:
    If the source symbol is "XAUUSD" and the destination symbol is "GOLD", specify:
    XAUUSD=GOLD
  • Remove Suffix of Copy Source
    Use this parameter if the source and destination symbols have different suffixes.
    Specify the suffix appended to the source symbol that should be removed before matching.
  • Add Suffix of Copy Destination
    Use this parameter if the source and destination symbols have different suffixes.
    Specify the suffix to be appended to the destination symbol when placing copied trades.
  • Conversion Ratio
    By default, the position size is calculated automatically according to the balance ratio between the source and destination accounts.
    If you need to increase or decrease the calculated position size further, use this parameter.
    If the method used to calculate position sizes differs between the source and destination environments, use this parameter to compensate for the difference and ensure the copied position size is calculated correctly.
    However, this tool cannot be used if the position size calculation method is consistent for some symbols but different for others.

          Example 1
            Source account balance: 1000
            Destination account balance: 100
            Source position size: 10 lots
            To calculate the destination position size based solely on the account balance ratio:
            Conversion Ratio = 1.0
            Destination position size:1 lot

          Example 2
            Source account balance: 1000
            Destination account balance: 100
            Source position size: 10 lots
            To calculate the destination position size based on the balance ratio and then reduce it by half:
            Conversion Ratio = 0.5
            Destination position size:0.5 lots

          Example 3
            Source account balance: 1000
            Destination account balance: 1000
            Source position size: 10 lots
            If, due to differences in the lot size calculation method, the destination position size must be ten times larger:
            Conversion Ratio = 10.0
            Destination position size:100 lots

          Calculation Formula
            (A) = (a) × (r) × (B) / (b)

            (r) = Conversion Ratio
            (A) = Destination lot size
            (a) = Source lot size
            (B) = Destination account balance
            (b) = Source account balance

On-screen Buttons

  Source (Trade_copy_src) / Destination (Trade_copy_des)
  • "NOT OPERATING"
    When "NOT OPERATING" is displayed, the EA does not monitor position status and does not copy any positions.
    Click the button to switch the status to "OPERATING".
  • "OPERATING"
    When "OPERATING" is displayed, the EA monitors position status and copies positions accordingly.
    Click the button to switch the status to "NOT OPERATING".
These users thanked the author funchi for the post (total 3):
global, mazibee, stond

CodeRe: Trade Copy

8
Hi funchi,

Thanks for the trade copier and the documentation. I made trades on MT4, copied them to MT5 and it's working very well. I checked all the entry and exit times and they are mostly the same to the second but the exit prices sometimes differ by a fraction of a pip and that is expected. Also, all the SL and TP prices are exactly the same, which means that the SL values were modified successfully since on the MT4 sending side, a trailing stop moved the SL values. However, I got some errors that I pasted below:

2026.07.21 06:42:47.335 Trade_copy_des (AUDCAD,M5) CTrade::OrderSend: modify position #5109484 GBPUSD (sl: 0.00000, tp: 0.00000) [no changes]
2026.07.21 06:42:47.335 Trade_copy_des (AUDCAD,M5) Alert: error : modifying position code=4756
2026.07.21 08:17:59.544 Trade_copy_des (AUDCAD,M5) CTrade::OrderSend: modify position #5110188 GBPCHF (sl: 0.00000, tp: 0.00000) [no changes]
2026.07.21 08:17:59.544 Trade_copy_des (AUDCAD,M5) Alert: error : modifying position code=4756
2026.07.21 09:36:35.346 Trade_copy_des (AUDCAD,M5) CTrade::OrderSend: modify position #5110914 GBPJPY (sl: 0.000, tp: 0.000) [no changes]
2026.07.21 09:36:35.346 Trade_copy_des (AUDCAD,M5) Alert: error : modifying position code=4756

What do you think may be the cause of those errors and what values can I change to avoid those type of errors in the future? Thanks.
These users thanked the author global for the post:
funchi

Re: Trade Copy

9
global wrote: Wed Jul 22, 2026 12:32 am Hi funchi,

Thanks for the trade copier and the documentation. I made trades on MT4, copied them to MT5 and it's working very well. I checked all the entry and exit times and they are mostly the same to the second but the exit prices sometimes differ by a fraction of a pip and that is expected. Also, all the SL and TP prices are exactly the same, which means that the SL values were modified successfully since on the MT4 sending side, a trailing stop moved the SL values. However, I got some errors that I pasted below:

2026.07.21 06:42:47.335 Trade_copy_des (AUDCAD,M5) CTrade::OrderSend: modify position #5109484 GBPUSD (sl: 0.00000, tp: 0.00000) [no changes]
2026.07.21 06:42:47.335 Trade_copy_des (AUDCAD,M5) Alert: error : modifying position code=4756
2026.07.21 08:17:59.544 Trade_copy_des (AUDCAD,M5) CTrade::OrderSend: modify position #5110188 GBPCHF (sl: 0.00000, tp: 0.00000) [no changes]
2026.07.21 08:17:59.544 Trade_copy_des (AUDCAD,M5) Alert: error : modifying position code=4756
2026.07.21 09:36:35.346 Trade_copy_des (AUDCAD,M5) CTrade::OrderSend: modify position #5110914 GBPJPY (sl: 0.000, tp: 0.000) [no changes]
2026.07.21 09:36:35.346 Trade_copy_des (AUDCAD,M5) Alert: error : modifying position code=4756

What do you think may be the cause of those errors and what values can I change to avoid those type of errors in the future? Thanks.
I believe this is a bug in the system.

Judging from the message, it appears that the system attempted to modify the SL/TP even though there were no changes to them.

I'll investigate the issue and let you know as soon as I find out what's causing it.
These users thanked the author funchi for the post:
mazibee

Re: Trade Copy

10
It turned out to be a bug in the system. I sincerely apologise for the inconvenience.

There was no issue when an order was placed with the SL and TP set at the same time. However, a bug occurred when an order was placed without an SL or TP, i.e. when using One-Click Trading.

I have now fixed the bug in the MT5 and MT4 receiver EAs.
These users thanked the author funchi for the post (total 4):
mazibee, global, Lucas, stond