Can You Run the MT5 Strategy Tester on a VPS?
Yes. MetaTrader 5’s Strategy Tester runs on a Windows VPS exactly as it does on a desktop computer. You can backtest an Expert Advisor, run a full optimisation, and even turn your VPS into a remote testing agent that your home computer uses.
The real question is not whether it works, but whether it is a good idea on the VPS that runs your live trading. The MT5 tester is built to use every processor core it can find. An optimisation that keeps all cores busy for hours can slow down the live EAs sharing the same server. Done carefully, though, a VPS is an excellent place to test: it runs around the clock, does not tie up your own computer, and can keep working while you sleep.
This guide explains how the MT5 tester uses resources, how to run tests on a VPS without affecting live trading, how to size a VPS for testing, and when a separate testing setup makes more sense.
How the MT5 Strategy Tester Uses Your VPS
Unlike MT4, which tests on a single thread, MT5 splits testing work across testing agents. Each agent is a separate process that runs one test pass at a time.
- Local agents run on the same computer as your terminal. MetaTrader 5 automatically creates one local agent for each logical CPU core. A VPS with 4 cores gets 4 local agents.
- Remote agents run on other computers. You install them with MetaQuotes’ MetaTester utility and connect them to your terminal over the network.
- MQL5 Cloud Network agents are other people’s computers that you can rent, paid per use, for very large optimisations.
A single backtest uses only one agent, so it uses one core. An optimisation, which tests hundreds or thousands of parameter combinations, uses every agent available at once. That is why optimisations are fast on a powerful machine, and also why they can monopolise a small VPS.
What else the tester uses
- RAM. Each agent loads price history and runs its own copy of your EA. Agents testing many symbols, or using detailed tick data, need more memory.
- Disk space. Agents store price history and tick data in a Tester folder. Testing with real tick data over several years can use many gigabytes per symbol.
- Network. The first time you test a symbol, MT5 downloads its history from your broker. A VPS in a data centre usually downloads this much faster than a home connection.
Single Backtests vs Optimisations
Single backtests are light. Testing one EA with one set of inputs uses one core and a modest amount of memory. On most VPS plans, you can run a single backtest during the trading week without any noticeable effect on live EAs, especially on a plan with two or more cores.
Optimisations are heavy. MT5 starts one pass on every agent and keeps all cores busy until it finishes. On a VPS that is also running live EAs, this can cause:
- Slower reaction to new ticks in your live terminals.
- Delays in order sending during fast markets.
- A sluggish remote desktop session.
The solution is to control how many agents the tester uses, and when.
How to Run the Tester Without Hurting Live Trading
1. Disable some local agents
You can choose how many local agents MT5 uses.
- Open the Strategy Tester (View > Strategy Tester, or Ctrl+R).
- Click the Agents tab at the bottom of the tester.
- Expand Local to see one agent per core.
- Right-click individual agents and choose Disable.
A good rule is to leave at least one core free for every two or three live terminals. On a 4-core VPS running two live EAs, for example, enable two or three agents rather than all four.
2. Optimise when the market is closed
The forex market closes from Friday evening to Sunday evening (New York time). That window is perfect for heavy optimisations: you can use every core without any risk to live trades. Start a large optimisation on Friday night and review the results on Saturday.
3. Use a testing terminal separate from your live terminal
Install a second copy of MT5 in a different folder and use it only for testing. If an optimisation crashes or freezes the testing terminal, your live terminal keeps running. Log the testing terminal in to a demo account; the tester does not need your live account.
4. Choose the right tick model
The tester offers several modelling modes, from Open prices only (very fast) to Every tick based on real ticks (most accurate, but slowest and most data-hungry). Use faster modes for early, broad optimisations, and save the real-tick mode for final checks of your best settings. This alone can reduce optimisation time and load dramatically.
5. Watch the resources
Keep Task Manager open on the Performance tab during your first few optimisations. If CPU stays at 100% or memory approaches its limit, disable another agent or move testing to the weekend.
Should You Use a Separate VPS for Testing?
For many traders, the best setup is two servers with different jobs:
- A live VPS in the data centre closest to your broker, sized for your live terminals, with spare capacity.
- A testing VPS with more cores, used for optimisation, which can be anywhere since latency does not matter for backtests.
Separating them means you never have to choose between optimising and trading. You can also connect the testing VPS to your home MT5 as a set of remote agents (see below), so optimisations you start at home run on the VPS’s cores.
If you only test occasionally, a single VPS with sensible agent limits and weekend optimisation is perfectly fine.
Turning a VPS into Remote Testing Agents
MetaTester lets you install agents on any 64-bit Windows computer and connect them to your MT5 terminal over the network.
- On the VPS, open your MT5 installation folder and run metatester64.exe as administrator.
- On the Services tab, choose the number of agents (typically one per core), set a password, and choose a port or port range.
- Note the VPS IP address shown on the tab.
- In the Windows Firewall on the VPS, allow incoming connections on the chosen port, but only from your own IP address if possible.
- On your home computer, open the MT5 Strategy Tester, go to the Agents tab, right-click Remote (or the farm list), and add the VPS address, port and password.
Your home terminal now sends optimisation passes to the VPS agents. The work runs on the VPS, and the results come back to your home terminal. Keep the password strong and the firewall rule narrow, because agents accept work from anyone who knows the address and password.
Note that remote agents do not allow DLL calls, and Print() messages from your EA are not written to the Journal on remote agents. If your EA relies on DLLs, test it with local agents instead.
How to Size a VPS for MT5 Backtesting
Use this table as a starting point. The more cores you have, the faster an optimisation finishes.
All Cheap Forex VPS plans list dedicated CPU cores and NVMe/SSD storage, which matters for the tester: dedicated cores give consistent speed, and fast storage helps when agents read large amounts of history. To understand the difference between core types, read shared vCPU vs dedicated CPU on a forex VPS.
Plan your disk space too. If you test many symbols with real tick data over several years, the tester’s history files can grow to tens of gigabytes. Check free space before starting large jobs, and delete old cache data in the Tester folder occasionally.
MT4 Users: What About the MT4 Strategy Tester?
The MT4 tester also runs on a VPS, but it is far simpler. It uses a single thread, cannot use multiple agents, and cannot use remote agents or a cloud network. A single MT4 optimisation therefore only uses one core and rarely affects live trading. It is also much slower. If you develop EAs seriously, the MT5 tester’s multi-core design is a strong reason to work in MT5. See can you run MT5 on a cheap forex VPS? for more on MT5 hosting.
Testing Workflow: From Backtest to Live on One VPS
- Develop and backtest in a separate testing terminal on a demo login.
- Optimise at the weekend using most of the VPS’s cores.
- Forward test on a demo account for a few weeks. A VPS is ideal because the EA runs 24/5, just as it would live. Read do you need a VPS to test an EA on a demo account?
- Go live in your live terminal on the same VPS, near your broker. Check your broker latency to confirm you are in the right location.
- Keep enough capacity. As you add EAs, revisit how many EAs a cheap forex VPS can run.
Frequently Asked Questions
Can I run the MT5 Strategy Tester on a VPS?
Yes. It works the same as on any Windows computer. Single backtests are light, while optimisations use every available core unless you limit them.
Will backtesting slow down my live EAs?
A single backtest rarely does. A full optimisation can, because it uses all cores. Disable some local agents in the Agents tab, or run optimisations at the weekend.
How many testing agents does MT5 create?
One local agent per logical CPU core. A 4-core VPS has 4 local agents.
Can my home computer use my VPS for optimisation?
Yes. Install remote agents on the VPS with MetaTester, then add the VPS address, port and password in your home terminal’s Agents tab.
How much disk space does the MT5 tester need?
It depends on how many symbols and how much tick history you test. Real-tick testing over several years can use many gigabytes per symbol, so keep spare space.
Is it better to backtest on a VPS or my own PC?
A VPS keeps running while your PC is off and downloads history quickly. A powerful home PC may have more cores. Many traders use both, connecting the VPS as remote agents.
Can I use the MQL5 Cloud Network instead?
Yes, for very large optimisations. It rents computing power from other MT5 users and charges per use. Your VPS is still the best place to run the EA live.
