Skip to main content

Improve MT4 Trade Copier speed on multi-core CPU machines

Local-Trade-Copier-Tutorials-improve-mt4-trade-copier-speed-1745x1080-1

In this blog post, I’ll show you how to improve MT4 performance and how to make sure your Expert Advisors and indicators are not suffering from unnecessary delays.

This literally allows you to speed up MT4 software when it is used on multi-core processor VPS servers. In this example, I will use one of my MT4 apps to demonstrate how to identify this problem and how to fix this, but you might experience the same problem with any other MT4 app in general.

Recently I have been receiving quite a lot of emails where people complain that my Local Trade Copier software is working very slowly. Results have been quite different for most of those trade copier users, but on average they have experienced somewhere between 10 to 60-second delay when copying trades. That is huge and not tolerable and should be fixed.

However, what I’ve found out is that everything is okay with my software and the problem comes from the MT4 platform when it runs on a multi-core CPU Virtual Private Server (VPS).

Do not get confused. Even if your hosting provider says that your VPS server has 1x CPU (processor) which has 4x cores, you will still experience MT4 performance problems. Yes, those CPU cores are virtual, they are not real, but that’s actually is the problem. If they were real MT4 would work fine. So it does not matter if your VPS has a 1x CPU with multiple cores or multiple CPUs, you need to use a special configuration to make your MT4 work efficiently.

So it is actually wise to choose VPS servers with just one single CPU and if you need more you can always rent an additional VPS server. Or, you can rent a dedicated server that does not have these problems and you can usually run dozens of MT4 instances on multi-core CPU platforms.

Normally the trade copier software should synchronize trades every 400 milliseconds, which is basically 2 times every second, and you can adjust the sync rate to make it work even faster. I’ve had this “slow copier” problem as well in the past so I want to share with you how to solve this problem.

This “slow MT4” problem is quite well known to programmers and there are lots of discussions about MT4 and multi-core processors. However, I do not want to throw technical terms and explanations at you. I just want to show you how to solve the problem when your MT4 is running slowly.

And even if your MT4 does not seem to run slowly, by applying this trick you might even be able to run more MT4 client terminals on the same VPS server.

Technically, the problem is that MT4 is a 32-bit application and this gives trouble to work efficiently on multi-core processor VPS (like Dual-core, Quad-core, etc).

This problem appears when you are running multiple MT4 client terminals on the same VPS server and this server has a multi-core CPU. Usually, the multi-core CPU on a VPS server is a “virtual CPU”, which means those CPU cores are not real physical CPU’s. They are virtual CPU cores. We just call it “virtualization”.

If you are running a single MT4 instance you should not face problems like this. This should not be a problem as well if you are running multiple MT4 instances on the VPS server that has only a single CPU. If you are running some simple MT4 app like this Partial Close EA then you might not face these problems as well.

But if your VPS server has more than one CPU and you are running more than one MT4 platform you will definitely see a delay in trade execution and other software operations.

How many CPU cores your VPS server has?

Here’s how to know how many CPU cores your VPS server has.

Click the right mouse button somewhere on the task-bar at the bottom of your Windows screen and in the pop-up menu choose “Start Task Manager“.

You can start Task Manager in Windows VPS server from this pop-up menu.

You can start Task Manager in the Windows VPS server from this pop-up menu.

When the “Task Manager” window loads up you need to switch to the “Performance” tab where you’ll see if you have multiple CPU cores or not.

Performance tab with 4x CPU cores in the Windows Task Manager.

Performance tab with 4x CPU cores in the Windows Task Manager.

In the picture above you can see this VPS server has 4x CPU cores.

The specifications of this VPS server are as follows:

  • AMD Opteron(tm) Processor 6136 (4 CPUs) ~2.4Ghz.
  • 8GB RAM Memory.
  • VPS system runs on a VMWare Virtual Platform.

If you switch to the “Processes” tab, you’ll find terminal.exe‘s in the process list. This is your MT4 processes and what you need to do is to set each of them to use the same CPU core.

By default, each process uses all CPU cores and in our case, this creates a problem for MT4.

MT4 terminal.exe process list in the Windows Task Manager.

MT4 terminal.exe process list in the Windows Task Manager.

To make this process more simple I suggest sorting that “Process” list by name by clicking on the column that says “Image Name“.

In this Task Manager process list, we see that there are 4x MT4 instances running. Each of those MT4 platforms runs several MT4 Copier EA instances which makes a total of 9x EA’s running on this VPS.

CPU Usage in the picture above is shown as 19% but it is actually jumping between 19% and 36% all the time. At a first glance, anyone might say that a CPU load of 36% or even 60% is not a big deal and VPS should work fine, however, this “CPU Usage” number seems to be incorrect in such a case.

The whole VPS system is working very slowly and it is even difficult to switch between windows. If I try to switch to another MT4 platform window I have to wait about 20-60 seconds. Obviously, trade copying on such a server would take ages and you would experience huge delays and price differences. I even had the same problem with only 2x MT4 instances and only two copiers EA’s (Server EA and Client EA).

A simple trick to make MT4 run faster on multi-core CPU servers

Now here’s a simple trick you need to apply to make MT4 client terminals (and of course all apps running inside these terminals) work faster. There are two options.

For some, option #1 helps speed up MT4, while others find only option #2 is actually helping.

Option #1: Set all terminal.exe processes to use the same CPU core.

To apply option #1 you need to set all terminal.exe processes to use the same CPU. It does not really matter which CPU core you’ll choose to use, what’s important is that all MT4 processes should use the same.

To make it simple I always set all terminal.exe‘s to use CPU0. This way MT4 will not need to split operations between multiple CPU’s and it will work faster.

It’s really easy to do and I will explain how it’s done a bit later, so keep reading.

IMPORTANT! If you leave one terminal.exe process using more than one CPU this trick will not work. It’s very important to have all terminal.exe‘s to use the same and only one CPU.

Option #2: Set each terminal.exe process to use a different CPU core.

If option #1 does not help you should also try option #2. To apply option #2 you need to set each terminal.exe process to use a different CPU core. Say your VPS has 4x CPU cores and you run 4x MT4 instances. Then all 4x MT4 instances should be set as follows:

  • MT4 instance #1 should use CPU0
  • MT4 instance #2 should use CPU1
  • MT4 instance #3 should use CPU2
  • MT4 instance #4 should use CPU3

If you have more MT4 platforms than you have CPU cores, you should close the rest of the MT4 instances (at least for testing purposes) to see if this option #2 solution helps you at all.

How to set MT4 to use certain CPU core

Configuring MT4, or any other process from the list, to use only a certain processor is quite easy. You need to switch to the “Processes” tab, choose the terminal.exe process from the list, click the right mouse button on that item, and choose “Set Affinity” from the pop-up menu.

In the “Processor Affinity” window you need to deselect all CPU cores and select only CPU0 like in the picture below.

Setting CPU affinity on MT4 terminal process in the Windows Task Manager.

Setting CPU affinity on the MT4 terminal process in the Windows Task Manager. This makes the MT4 platform to work only using a single CPU core for faster performance.

When I did this for all 4x MT4 instances I am running on my VPS all of them started to work efficiently. I can now switch between windows easily and CPU Usage dropped as well to 16% – 29% (even though I still think this number does not show correct values on VPS servers).

Obviously, I can copy trades at the fastest speed possible. Trades are transferred between the MT4 platform in under 1 second now.

MT4 Trade Copier speed is just one piece of the puzzle

I would mention that Local Trade Copier’s speed has little to do with how fast your trades are copied between MT4 platforms. In most cases, delays come from the problems like slow MT4 (like in this example), poor internet connection, or even execution delays from your broker. There were even cases when brokers delay trade execution on purpose for some economic news scalpers/traders.

To list all potential problems that affect trade copying speed I would list them in the following order (where 1st item is the most common problem and the last item is the least common problem):

  1. Slow MT4 performance because of the multi-core CPU VPS server.
  2. Too many MT4 client terminals running on the same VPS server.
  3. Slow MT4 performance because of too many 3rd party indicators or Expert Advisors running on the MT4 terminal.
  4. Slow VPS performance because of 3rd party software (anti-virus, firewall, Internet browsers, and other apps).
  5. Poor internet connection. I know all VPS providers will say that their connection is high quality, but even world-class services have issues from time to time. Keep this in mind. On the other hand, it’s not necessary your service provider is the one to blame for a bad Internet connection. There can be several or even dozen servers/gateways in between your VPS and your broker’s server.
  6. Your MT4 app problem.

I won’t deny that my MT4 apps or MT4 copier might have problems running on your MT4 or your VPS. This has happened in the past and I did a lot of work to fix this. However, based on the last few years and tens of solved “slow trade copying” cases I’ve noticed that it’s always MT4, VPS, or Internet connection problem. When you finally fix the problem with the trade copying speed you can even try to copy your Forex trades at a better price.

How to know if your LTC copier is slow

So how to know if it’s the Local Trade Copier working slow and does not copy trades fast enough or is it that the problem lies in the slow execution from your broker?

That’s quite simple. Both, Server EA and Client EA have special counters in the blue dashboard that are growing on each synchronization cycle. Server EA has a “Server send” counter and Client EA has a “Server read” counter.

Server send counter in the blue dashboard of the LTC Server EA.

“Server send” counter in the blue dashboard of the LTC Server EA.

If counters on all LTC EA instances are growing steadily, consistently, and rapidly (according to your SyncRate setting in the EA Inputs), then it looks like your copier is working fine. If you see one of those counters growing slow and randomly, you should apply option #1 and/or option #2 solutions explained earlier in this article.

If counters on all LTC EA’s are growing steadily and consistently, but trades are still copied slowly, then you should also check the execution time. After each copied trade Client EA will print information in the “Experts” tab at the bottom of the MT4 client terminal about the trade execution speed, price deviation, and slippage.

Local Trade Copier reports broker execution speed on copied trades.

Local Trade Copier reports broker execution speed on copied trades.

In the picture above you can see Client EA reported that it took 203ms to execute the trade. This obviously does not include the synchronization time (the time required for the copier to actually send the signal from the master to the client account).

These 203ms are the time spent to deliver the “open trade” request to the broker’s server, actually, get the trade executed and receive a confirmation answer from the broker’s server.

In other words, this is out of control for the trade copier software or any other MT4 app. This depends on how fast your Internet connection is and how fast your broker’s execution speed is.

Under normal conditions, you should get an execution delay somewhere between 50-300 ms. If you want to get this close to 1ms, or something like that, you should rent a VPS server which is on the same network as your broker’s server. You can contact your broker to find out such information.

For example, there’s only about 35ms latency between one of HotForex Data Centers and the vpsforextrader.com network. And if you want even better latency you can rent a VPS server located in the Netherlands. This company has a network there too.

Local Trade Copier reports price deviation and slippage on copied trades.

Local Trade Copier reports price deviation and slippage on copied trades.

In the picture above we also see that the copier reported actual price deviation on the copied trade comparing it to the original trade’s open price.

In this case, there was a price difference of 0.6 pips which is considered very low under such circumstances.

This report also included slippage which was zero in this case. Slippage is something you cannot avoid, but the first thing you need to find out is whether the slippage you get is the result of a bad Internet connection or it’s your VPS server running slowly.

Trade copier speed troubleshooting checklist

  1. After each trade is copied there will be a message logged in the “Experts” tab which gives the exact slippage and delays in ms. This way you can know if a delay is coming from the broker/internet connection. If you get an execution delay between 50ms and 300ms then your Internet connection and broker is working fine.
  2. Check if “Server read” and “Server send” counters are growing steadily or randomly. If one of these counters grow randomly, with delays, then it means your computer is slowing down the trade copier software.
  3. Check if your VPS server has multiple CPUs or just a single CPU. If you have a single CPU then try closing 3rd party applications and remove other EAs and indicators from your MT4 to make it work faster. If this does not help then maybe you are running too many MT4 instances and/or simply need to get a better and more powerful computer.
  4. If your VPS server has multiple CPU cores then you might suffer from the well-known MT4 issue that it cannot work efficiently on multiple CPU core machines. In that case, you would have to set all terminal.exe’s to use the same CPU. This can be done from the “Processes” tab in the “Task Manager” window. You need to select each terminal.exe and choose “Set Affinity“. Then in the CPU list window, you need to select which CPUs each process should use. The idea here is to try two operational modes: 1) Set all terminal.exe’s to use the same CPU0; 2) Set each terminal.exe to use a different CPU.

If you have tried all that above and still have slow trade copying speed you should contact me.

Conclusion

If your MT4 is running slowly and your VPS server provider tells you that everything is okay on their side, you should check if your VPS is a multi-core CPU machine. MT4 cannot work efficiently on multi-core CPU VPS servers and requires some additional configuration.

I hope that this article has helped you find the cause of your slow MT4 problem and possibly fix it.

So, have you suffered from this problem before? Or maybe you are still struggling to find a solution to this? If you tried all that, did it helped? Please post your comments below.

Rimantas Petrauskas

Rimantas Petrauskas is one of the most well-known programmers among Forex traders. Having more than 20+ years of programming experience, he created two of the most popular trade copiers for the MetaTrader 4 platform—the Signal Magician and Local Trade Copier. Rimantas is also a best-selling author on Amazon after his book "How to Start Your Own Forex Signals Service" hit #4 in the Forex category during the first launch week.

45 Comments

  • Torsten Kroeger says:

    Hi Rimantas,
    thank’s a lot for your email!
    Eventually I have just solved my main headache with the VPS, after I read your above text. Your explanations were very easy to understand and to follow the executions. To tell you this, I run 13 Terminals on one VPS with 3-4 LTC’s (clients) on each of 4 terminals and on the other 9 terminals there are 9 Server EA’s. Man, to change/save something or even to switch from one terminal to the next it is so slow. Now I have followed your recommendation 1 and switched all terminals on one CPU. This system has just 2 CPU’s. If you go on the VPS website You notice the performance of my Server i selected. http://www.myforexvps.ru/en.html

    Anyway, what i haven’t figured is to shift all apps on to my computer to upgrade to Windows Server 2008. I am (VPS) still running on Windows 2003. The support has told me that this upgrade is not a problem at all. I have to be aware that all my datas get lost when they would do this job. I don’t know how to do this shift.

    Okay, may be in a quiet moment you can tell me if this upgrade is necessary or if this VPS service doesn’t seem to be trustworthy for you. The price is quite reasonable.

    Best regards,
    Torsten

    • Dear Torsten, first of all thank you for your comment. I am really glad my suggestion have helped you solve the problem.
      Your VPS price looks quite reasonable. I do not have experience with this company, but if it works great for you then obviously I suggest you keep staying with them.
      As about the upgrade from 2003 to 2008, personally I would go for it. I am happy I made the same decision on my VPS servers last year.
      I would just suggest you to save all MT4 Profiles into file and also save all passwords into file. You should backup that data, because after re-installation that might get lost so you will have to restore it.

      Hope this helps.

      Regards,
      Rimantas Petrauskas

      • raj says:

        hi

        I am getting error saying “cannot open file” followed by the path pointing to the indicator that i have attached with few EAs.

        I am able to attach this indicator to the chart separately and it is working fine.

        This problem just started 2 days back until then it was working fine and there was no error message.
        I have compiled the indicator few times but still the problem persist.

        another problem is that another message shows “no data available” for another indicator which I have attached to few EA as well. I am using VPS for running MT4.

        Kindly reply.

        Raj

    • Stephen says:

      Hi Rimantas,

      We have signed up with MyForexVPS VPS XPERT and are trying to run 10 terminals but things have started to slow down, even with CPU affinity setting in place.

      What are we doing wrong?

      Stephen

      • Hi,

        I would recommend to take 1-CPU VPS servers and if you need take multiple of them rather than take one VPS with multiple CPU cores. MT4 does not work well with multiple CPU core VPS servers.
        On the other hand, if you can rent a dedicated server, then it can have multiple CPU cores and that will work fine, because it’s dedicated server.

        1-CPU core VPS server normally can run about 5x MT4 platforms max (depends on sever specifications), but if it had multiple cores it just makes everything slow.

  • Torsten Kroeger says:

    I have forgot to mention which VPS: it’s the XPERT version I use. It’s up to 25 terminals.

    Torsten

  • Conway says:

    Fantastic find Rimantas!

    Thanks for sharing your findings and knowledge on this.

    I am just about to load a second platform to one of my NY VPS and was considering upgrading to another core, I may still have to but your suggestions are well received.

  • Michael says:

    Hi,Do you develop copier programme from Mt4 client to fxinside?

  • anjum says:

    sir
    I daily read u r mail.Its good & very helpful knowledge to me & other new investor.
    keep on doing.
    thank sir

  • syed anjum jafri says:

    hello
    i closely read all the details.thanks for this knowledge.its really strange no one bothered to tell all these things before. i will do the needful and revert back to you for any help if any problem arises.
    thanks rimantas.

  • Jilles says:

    Hi, I had a lot of troubles with my VPS. First I used 2 Cores. When I tried working with 7 Terminals I got problems so I was thinking 2 more Cores will do better! The opposite was true, unbelievable slow, much and much slower than it was before. Lots of discussions with people from the VPS company. Finally I removed the 2 extra Cores and it was like before, not bad but I want to have it a little bit better. I switched all my 4 Terminals to CPU0 as you told me to do and the speed, especially when I switch from Terminal to Terminal with the charts increases a lot! I am going to install a few more Terminals now.

    Thank you very much my friend!

    Regards from Holland,
    Jilles

  • Muhammad Farrukh says:

    Hi,

    I have been a victim of this issue since last 5 year and I have checked all the available solutions on google which are around clearing the history and download this and that. This is the most effective solution to speed up your meta trader 4.

    Thanks for sharing the solution and I really appreciate that.

    Regards

    Muhammad

    • Dear Muhammad,

      I am so glad this have helped you to solve the problem with your slow MT4. Thanks for your feedback.

      Regards,
      Rimantas Petrauskas

      • Manjit says:

        Hi Rimantas – I liked your article – however when I tried it my processes etc look different – when I right click there is no Affinity button and I have to click on Resource monitor I can see all the exe files and they flash on different cpus but I dont know how to change the allocation – can you help?
        Thanks
        Manjit

        • How different it looks like?
          Do you have the “More Details” button at the bottom of the Task Manager? Click it.
          Then switch to the “Details” tab and you’ll be able to find the “Set Affinity” option.

  • n says:

    Hi,

    Thank you for the article.
    I tried the first option on on my local computer i7 6700k with 8 MT4 terminals and the CPU process reduced to half but then each of the MT4 runs slow.The second option didn’t change anything..
    If the affinity is set to all,each MT4 uses 10-20% CPU when aggressive time.Which is too much and if over 80% it starts to jump.

  • Graham says:

    hey Rimantas I have a problem to solve when I run 2 metatraders I get constant disconnections on 1 or the other and I have very good internet connection

  • Mandy says:

    Great article.

  • Francis says:

    Hi,

    I found a VPS where my ping to the broker would be roughly ~1.5ms. However, I do have a more than capable spare computer at home which the average ping would be at 20ms to the same broker. Am wondering, is it really worth the extra 20-30$ to have a Linux VPS and then install Virtualbox so I can run MT4 without using Wine?

  • Rodrigo Magalhaes says:

    But every time I restart the vps, or restart mt4 have to do all this again?

  • Indy says:

    Option #1 absolutely works for me.

    I have my own dedicated Linux server with virtual Windows 8.1 and everything was terribly slow (VPS with 8 CPU, 48GB RAM and 6-7 MT4 terminals + Tick Data Suite, Strategy Quant etc). I was unable to test my strategies and yes, when I think about it, it slows down as I added virtual procesors and MT4 terminals. Option #2 doesn’t helped. Then I switched to 1CPU and everything works. Switching back to 8CPU and setting afinity 1 for every terminal and works too. Now I can utilize my machine when running genetic alghorithms and run smoothly MT4 terminals and Tick Data Suite backtests.

    For everyone: you can start MT4 on one core with this command:

    C:\Windows\System32\cmd.exe /c start “Process Monitor” /affinity 1 “C:\Program Files (x86)\XM UK MT4 TEST\terminal.exe”

    Thank you very much Rimantas.
    Indy.

  • RG says:

    Hello Rimantas,
    Did you local copier could copy hedging position? i means if master have some ea martingle hedging so open buy and sell instantly could it copy them without problems?

  • Roland says:

    Hello Rimantas,
    I would like to open about 150 mt4 terminals on a specifique vps ( Google Cloud vps), So what vps feature (CPU, RAM, HDD,…) is necessery to make it possible ? I also want to know if in this case set all the 150 terminal.exe processes to use the same CPU core is the best solution to improve mt4 trade copier speed.
    Thanks a lot.

  • Randy says:

    The above ideas have been most helpful. I now have about 11 MT4’s on my VPS, and here is how I make starting up a lot easier.
    1. I created a file called
    VPS Start MT4 affinity 1.bat
    on my desktop.
    2. For each MT4 installation, I add the following 3 lines to the file:
    REM *****ACCT# and SIMPLE DESCRIPTION*****
    C:\Windows\System32\cmd.exe /c start “” /affinity 1 “C:\Program Files (x86)\MT4 DIRECTORY NAME\terminal.exe”
    TIMEOUT 180
    3. Note that “C:\Program Files (x86)\MT4 DIRECTORY NAME\terminal.exe” should exactly match whatever you see in the Target field when you right click on the MT4 installation’s icon and click on properties. Copy it from there.
    4. TIMEOUT 180 will wait 3 minutes after opening one instance before opening the next instance. I did this to prevent everything starting at one time. Further, it will display a prompt that shows the countdown in seconds and invites you to hit any key to skip the delay to the next MT4 instance.
    5. In my usage, it generally takes about 60s-90s to start an MT4 instance, and once it is running, I usually just hit the space bar to skip to the next one.
    6. Alternatively, let it run the fully 3 minutes between each, go do something else, and check it when done. Feel free to increase/decrease 180 per your usage.

  • Bernhard says:

    Thank you for this article!!!

  • Manjit says:

    I wonder can anyone help as the Task manager I have shows resource manager but no way to place an affinity for the exe to the cpu? When you right click does not show that option.

  • Farzad says:

    Wow, this article solved all the issues I have been having with my VPS/copiers which none of the technicians and ITS were able to resolve! I resorted to upgrading my VPS, changing my windows platform, changing VPS, switching VPS provider, combining Forex accounts into less accounts and a myriad of other failed attempts at speeding up my metatrader instances! This simple solution worked like a charm. I am running 8 instances of metatrader on the cheapest VPS at a lightening speed!! thank you for sharing this information.

Leave a Reply