An expert advisor only trades while its MetaTrader terminal is open and connected to your broker. Turn off your computer, lose your internet connection or let Windows restart for an update, and the EA stops working. A virtual private server, or VPS, solves this by running MetaTrader on a remote machine that stays on around the clock.
Why an EA needs to stay online
An EA doesn't live at your broker. It runs inside the terminal on whichever machine you attached it to, and it can only react to prices while that terminal receives them. When the terminal goes offline:
- No new trades open, even if the setup the EA is waiting for appears.
- Trade management stops. Trailing stops, break-even moves and partial closes are made by the EA itself, so none of them happen.
- Broker-side orders stay in place. A stop loss or take profit already sent with the trade sits on the broker's server and still works. Hidden or “virtual” stops that the EA tracks internally do not.
- Basket exits fail. Grid and basket EAs that close a group of trades at a combined profit or loss can't do it, which is one reason our grid and martingale guide stresses uptime.
Our guide to expert advisors explains this event-driven design in more detail. The practical point is simple: if you want an EA to trade all week, something has to keep its terminal running all week.
Home PC, VPS or built-in hosting
You have three realistic ways to keep a terminal running:
| Option | How it works | Suits | Watch out for |
|---|---|---|---|
| Your own computer | MetaTrader runs on your desktop or laptop. | Testing, demo trading and EAs you watch closely. | Sleep mode, updates, power cuts, internet outages and distance from the broker. |
| Forex VPS | You rent a remote Windows server and use it like a second PC through Remote Desktop. | Several terminals, any EA or indicator, full control. | You handle setup, updates, restarts and security yourself. |
| MetaQuotes virtual hosting | You rent a hosted copy of your terminal from inside MT4 or MT5. | One account with a few EAs and a simple setup. | One account per subscription, no DLL calls, and changes must be migrated. |
A VPS runs in a data centre with backup power and fast network links, so it avoids most of the interruptions a home computer suffers. It isn't immune to problems, which is why the maintenance section below matters.
Location and latency
Latency is the time a message takes to travel from your terminal to your broker's trade server and back. MetaTrader shows it in the bottom-right corner of the window, next to the connection status. Click that area to see the broker's access servers and the ping to each one.
The biggest factor in latency is physical distance. A VPS in the same data centre or city as your broker's trade server typically sees a ping under 10 ms. A home connection on another continent can easily be 100 ms or more. Many brokers host their trade servers in large financial data centres in cities such as London, New York or Tokyo. Your broker's support team can tell you where theirs are, and the server name in MetaTrader sometimes hints at it.
How much latency matters
- Scalping and news EAs. Trades last seconds or minutes and aim for a few pips, so a slower round trip means more slippage and more missed prices. Location matters most here.
- Intraday EAs on M15 to H1. Lower latency helps a little, especially at session opens, but it's rarely the deciding factor.
- Swing EAs on H4 or D1. A few milliseconds make almost no difference. Reliable uptime matters far more than speed.
Measure before you commit. Once you have a VPS, install MetaTrader, log in and read the ping from the status bar. If it's much higher than you expected, a different location is worth trying.
RAM, CPU and storage
MetaTrader is light compared with most modern software, but every terminal you run needs its own share of memory and processor time. These are the things that add load:
| What adds load | Why | How to keep it down |
|---|---|---|
| Number of terminals | Each MetaTrader installation runs as a separate program. | Use one terminal per account and close any you don't need. |
| Open charts | Each chart keeps its own history and redraws on every tick. | Close charts that don't host an EA. |
| Bars of history | Long history uses memory and slows start-up. | Lower Max bars in chart under Tools > Options > Charts. |
| Heavy indicators and EAs | Some recalculate many bars or symbols on every tick. | Check CPU use in Task Manager during a busy session. |
| Strategy tester | Optimizations can use every processor core. | Run tests on your own PC, not on the trading server. |
A single terminal running a few EAs is a light load for most servers. If you plan to run several terminals, choose a plan with headroom, then watch Task Manager during a busy period such as the London open. If memory sits near the limit or the processor stays busy, move up a plan. Our forex market hours tool shows when the busy sessions fall in your time zone.
Fast SSD storage helps terminals start quickly and load history. Leave free space for logs and price history, because MT5's tick data in particular can grow large over time.
Windows or Linux?
MetaTrader 4 and 5 are Windows applications. A Windows VPS runs them exactly the way your own PC does, which makes it the simplest choice for most traders. You connect to it with Remote Desktop, which is built into Windows, and you see a normal Windows desktop.
MetaTrader can also run on Linux through Wine, a compatibility layer, and MetaQuotes publishes instructions for this. Linux servers are often cheaper and lighter, but setup is more technical, tools that depend on Windows DLLs may not work, and troubleshooting is up to you. Unless you are comfortable with Linux, choose Windows.
How to move MetaTrader onto a VPS
The process takes under an hour the first time. Do it at the weekend or at a quiet time, with no open trades if possible.
- Pick the server location closest to your broker's trade server, and a Windows plan sized for the terminals you plan to run.
- Connect with Remote Desktop using the address, user name and password from your provider. Change the password to a strong one you don't use anywhere else.
- Install MetaTrader on the VPS, downloaded from your broker's own website so it's set up for their servers. For several terminals, install each one into its own folder.
- Log in to your trading account with File > Login to Trade Account, and check the connection status shows a ping rather than an error.
- Copy your tools. On your PC, open File > Open Data Folder and copy your EAs from
MQL4/ExpertsorMQL5/Experts, indicators fromMQL4/IndicatorsorMQL5/Indicators, and any.setfiles. Paste them into the same folders in the VPS's data folder. Remote Desktop lets you copy and paste files between the two machines. - Refresh the Navigator or restart MetaTrader, open the charts you need and attach each EA with its settings. Our installation guide covers this step in detail.
- Enable trading. Switch on Algo Trading in the toolbar (AutoTrading on older MT4 builds), and tick Allow Algo Trading on each EA's Common tab. If a tool checks its license online, add its address under Tools > Options > Expert Advisors.
- Check the logs. The Experts tab should show each EA loading without errors, and the Journal tab should show a successful login.
- Stop the EAs on your PC. Remove them or switch off Algo Trading there, so the same account isn't traded twice.
- Disconnect, don't sign out. Close the Remote Desktop window to leave the session running. Signing out of Windows closes MetaTrader.
If a tool is licensed to a computer rather than to your trading account, you may need to reactivate it on the VPS. Check the developer's instructions first.
MetaQuotes' built-in virtual hosting
Both MT4 and MT5 include a hosting service run by MetaQuotes. You start it from inside the terminal: right-click your account in the Navigator and choose to register a virtual server. The terminal lists hosting locations with the ping from each to your broker and suggests the closest. After you subscribe, you migrate your charts, EAs, indicators and settings to the hosted copy, and it keeps running when your own computer is off.
It's convenient, but it works differently from a VPS:
- One account per subscription. Each trading account needs its own.
- No desktop. You can't log in to the hosted terminal. You check its status and logs from your local terminal instead.
- Changes must be migrated. If you change an EA's settings or add a chart locally, nothing changes on the server until you migrate again.
- No DLL calls. Tools that rely on DLLs won't run. If a tool checks its license online, confirm with the developer that it works there.
- Turn off local trading after you migrate. Otherwise both copies run the same EAs on the same account.
For one account and a few standard EAs, built-in hosting is often the easiest route. For several accounts, DLL-based tools or other software alongside MetaTrader, a full VPS gives you more control.
Keeping it running
A VPS removes most interruptions, not all of them. A few habits keep the remaining ones short:
- Check the Experts and Journal tabs after every restart and every time you connect. Errors, disconnections and failed orders show up there first.
- Plan for restarts. Windows updates can restart the server. Schedule them for the weekend when the market is closed, and put a MetaTrader shortcut in the Windows Startup folder. MetaTrader reopens its charts with the EAs attached the way you left them.
- Remember the sign-in step. Programs in the Startup folder only start when your user signs in. After a reboot, reconnect with Remote Desktop, or set up automatic sign-in, before MetaTrader comes back.
- Get alerts on your phone. MetaTrader can send push notifications to the mobile app through your MetaQuotes ID, set under Tools > Options > Notifications. Many EAs use this for trade and error alerts.
- Keep the server clean. Install only what you need, keep Windows updated and don't browse the web from the trading server.
- Review risk, not just uptime. A VPS makes it easy to leave EAs running unattended. Our risk management guide covers the drawdown limits worth setting before you do.
A VPS keeps your EA trading, but it doesn't change what the EA does. Test any tool on a demo account first, then move it to the server once you are happy with how it behaves.