VPS for Expert Advisors — Run Your EA 24/7
A VPS (Virtual Private Server) lets you run MetaTrader 5 and your Expert Advisor 24/7 without keeping your PC on. According to MetaTrader 5 Virtual Hosting, the service provides "round-the-clock operation of the trading platform, even when your computer is turned off" and "minimum network latency to your broker's trade server." This guide explains why EAs need a VPS, broker VPS vs third-party, official MetaTrader Virtual Hosting, setup steps, and best practices — so your EA keeps trading when you're away.
What is a VPS for EAs?
A VPS is a remote computer in a datacenter that runs 24/7. You install MetaTrader 5 on it, log in with your account, attach your EA, and enable AutoTrading. When you disconnect, the EA keeps running on the VPS. MQL5 VPS describes it as "Trading VPS Hosting for MetaTrader 4/5" — a specialized solution so "signals and trading robots work around the clock with minimal network latency."
Why Run Your EA on a VPS?
| Problem without VPS | With VPS |
|---|---|
| PC off or asleep → EA stops | EA runs 24/7 on remote server |
| Power or internet outage → missed trades | Datacenter power and connectivity |
| High latency from home connection | Server near broker → 0–5 ms in many cases |
| You must leave PC on 24/5 | Run EA and close your laptop |
For scalping or any strategy that depends on fast execution or 24/5 coverage, a VPS is the standard solution. After backtesting and deploying to Demo, moving to a VPS for live trading is the next step.
Broker VPS vs Third-Party VPS
| Option | Pros | Cons |
|---|---|---|
| Broker VPS | Often free (min. deposit/volume); usually in same datacenter as trade server; one provider for account + hosting | Tied to one broker; rules vary by broker |
| Third-party / MetaQuotes VPS | Use with any broker; 24h free trial; rent from MT5 in a few clicks | Monthly cost (e.g. from ~$10–15); you choose plan |
Many brokers offer a free VPS if you meet their conditions — check your broker’s website or support. If not, MetaTrader 5 Virtual Hosting or MQL5 VPS are official options you can rent from the platform.
MetaTrader 5 Virtual Hosting (Official)
MetaTrader 5 Virtual Hosting (Forex VPS) is the official service: "Renting a virtual server straight from the MetaTrader 5 platform is the optimal way to ensure uninterrupted operation of your trading robots and signal subscriptions."
Advantages (from official page):
- 24 hours' free trial — no extra setup
- Rent from MetaTrader 5 in a few clicks
- Minimum latency to your broker’s trade server
- 24/7 operation of EAs and signal subscriptions
- No need to configure a generic VPS yourself — the platform handles the transfer
MQL5 VPS adds: "96% of broker servers can be accessed in less than 10 ms, while 84% — in less than 3 ms" and "up to 3 GB of RAM, up to 16 GB of hard disk space and several CPUs are allocated on demand." Plans range from about $10–15/month depending on commitment (e.g. 1–12 months).
Setup Steps: From Zero to Running EA
- Get a VPS — From your broker (if free) or via MT5 Virtual Hosting / MQL5 VPS: in MT5, use the VPS / Virtual Hosting entry and follow the rental steps.
- Connect to the VPS — Use Remote Desktop (RDP) with the IP and credentials provided. On Windows: Win+R →
mstsc→ enter the VPS address. - Install MetaTrader 5 — Download and install MT5 on the VPS if not pre-installed.
- Copy your EA — Copy your
.ex5(and if needed.mq5) from your PC to the VPS (e.g. via RDP clipboard or file share) intoMQL5\\Experts\\. - Log in — Open MT5 on the VPS and log in with your Live (or Demo) account.
- Attach the EA — Open a chart, drag the EA onto it, set parameters, enable AutoTrading (button in toolbar).
- Disconnect — Close the RDP session; the EA keeps running on the VPS.
Tip: Choose a VPS in the same region as your broker’s trade server (e.g. London for UK brokers) for lowest latency. See Deploy and Maintain Your EA for the full deployment checklist.
Latency and Server Location
Latency is the delay between your EA’s order and the broker’s server. For scalping and fast strategies it matters a lot. Official MQL5 VPS states that "More than thirty hosting points around the world provide optimal access to trade servers of any broker" and that "0–5 ms" latency is typical when the VPS is close to the broker. If you use a generic VPS, pick a location in the same city or region as your broker’s server.
Maintenance and Troubleshooting
- Check the EA regularly — Log in via RDP and check the Experts tab for errors; review the Journal.
- Windows updates — Configure the VPS so updates don’t restart at critical times, or accept a short maintenance window.
- Broker disconnects — If the broker restarts servers, MT5 will reconnect; ensure AutoTrading stays enabled.
- EA not trading — Verify symbol in Market Watch, sufficient margin, and that the EA is allowed to trade in its Properties. See Common MQL5 & EA Errors for frequent issues.
Next Steps
- Deploy and Maintain Your EA — Full flow: compile → backtest → Demo → VPS → Live.
- Build Your First EA — If you haven’t built an EA yet.
- Backtest Your EA — Test on history before going live.
References: MetaTrader 5 Virtual Hosting, MQL5 VPS.