Guide · 9 min read · Updated 2026-11-17

Do You Need a VPS for an MT5 EA? Uptime, Latency and Cost

Do you need a VPS for an MT5 EA? What stops when MT5 is closed, how latency affects XAUUSD fills, VPS cost vs account size and safe setup steps.

An Expert Advisor only trades while the MetaTrader 5 terminal it sits in is open, connected and allowed to trade. Close the laptop lid and the EA stops. A VPS (virtual private server) is a remote Windows machine that keeps MT5 running 24 hours a day. This guide explains when you actually need one for a gold EA, what latency does and does not change on XAUUSD, what a VPS costs compared with your account size, and how to set one up without running the same EA twice.

What happens to an EA when your computer is off

An EA is a program inside your MT5 terminal, not on the broker's server. When the terminal closes, sleeps or loses the internet, the EA stops reading prices and cannot send orders. What the broker keeps and what it does not:

ItemTerminal closedWhy
Open positionsStay openThey live on the broker's server
Stop loss and take profit already on the orderStill workThe broker executes them
Pending orders already placedStill workHeld on the server
New entries from the EAMissedThe EA is not running
Trailing stop, break-even, time exit, daily loss limitDo not runThese are logic in the EA or terminal

The last row is the dangerous one. The MT5 built-in trailing stop is also terminal-side, so it stops moving when MT5 closes. An EA that is meant to close every trade at a set hour, or to stop trading after a daily loss, cannot do either while it is offline. Always check that the EA sends a real stop loss with each order; then an outage costs missed trades rather than an unprotected position.

Uptime: how much trading time a home PC misses

Gold trades around 23 hours a day, Monday to Friday, at many brokers. Suppose your PC is off 8 hours each night:

  • Missed time: 8 ÷ 23 ≈ 35% of the trading day.
  • Over a 5-day week: 40 of about 115 hours.

Whether that matters depends on when the EA trades. A session EA has a fixed window. The London Breakout EA, for example, builds its range from 00:00 to 07:00 server time by default, opens trades only between 07:00 and 12:00, and closes any open trade at 20:00. If the terminal is off during the range hours the EA has no range for that day, and if it is off at 20:00 the time exit does not happen. The NY Opening Range EA needs to be running at the New York open to measure its range at all. For a server time zone that puts these hours in your night, a VPS is close to required.

Other common outages: Windows updates that restart the PC, power cuts, Wi-Fi drops, and the PC going to sleep. Each one is silent; you usually find out only when you check the Journal.

Latency: what a faster connection actually changes

Latency is the round trip between your terminal and the broker's trade server. MT5 shows it in the bottom-right corner of the window, next to the connection bars, in milliseconds. A home connection far from the server might show 120 to 250 ms. A VPS in the same data-center region as the server can show 1 to 10 ms.

Lower latency means your order reaches the server sooner, so the price has less time to move before it fills. Whether that is worth paying for depends on how far the EA's targets are:

  • Swing or H1 EA with a 10 USD stop on XAUUSD. If slower routing costs an average of 0.05 USD of extra slippage per fill, that is 0.05 ÷ 10 = 0.5% of the risk. Small.
  • M1 scalper with a 1.50 USD stop. The same 0.05 USD is 0.05 ÷ 1.50 = 3.3% of the risk on every fill, and a trade has two fills.

In dollars: at 1 lot (100 oz) each 0.10 USD of slippage is 10 USD. A scalper doing 200 round trips a month at 1 lot with 0.05 USD extra per fill pays 200 × 2 × 0.05 × 100 = 2,000 USD a month in avoidable cost. These slippage figures are illustrative; real slippage depends on the broker, the account type and the market at the moment. The point is the ratio: the shorter the stop, the more latency matters, which is the same logic as spread in XAUUSD spread explained.

Latency does not fix news spikes or weekend gaps. When gold jumps several dollars in a second, a 2 ms connection still fills at the price that exists.

What a VPS costs against your account

Three common options:

  • MetaTrader built-in virtual hosting. Rented from inside MT5 (Navigator, right-click the account, Register a Virtual Server). It runs a copy of your terminal's charts and EAs on a server chosen for low latency to your broker. Pricing is per month, cheaper on longer plans; check the current price in the terminal.
  • Broker VPS. Some brokers give a free VPS to accounts that meet a deposit or trading-volume condition. Read the condition before you count on it.
  • General Windows VPS. You rent a Windows server, install MT5 yourself and log in by Remote Desktop. More control, more setup. For one or two terminals, 1 to 2 CPU cores and 2 to 4 GB of RAM is usually enough.

Treat the fee like any trading cost. At an example price of 15 USD a month:

Account sizeCost per monthCost per year
300 USD5.0%60%
1,000 USD1.5%18%
5,000 USD0.3%3.6%
10,000 USD0.15%1.8%

On a 300 USD account the EA must earn 60% a year before costs just to pay for the server, which is not a realistic baseline. For a small account, a free broker VPS, a PC that stays on, or testing on demo first often makes more sense. If the account is small because you are still testing, see the 1% risk rule guide for sizing and use the XAUUSD lot size calculator so a VPS outage is never the only thing between you and a large loss.

Setting it up without double trades

  1. Test locally first. Run the EA on a demo account and backtest it in MT5 so you know what normal behaviour looks like. Installing the EA is covered in how to install an EA in MT5.
  2. Match the symbol. Attach the EA to the exact symbol your broker uses (XAUUSD, XAUUSDm, GOLD...) and check the lot step and minimum lot.
  3. One live copy only. With built-in hosting, the migrated copy runs on the server. If the same EA is also running on your home terminal on the same account, both can open trades. Turn Algo Trading off at home, or remove the EA there.
  4. Re-sync after every change. With built-in hosting, changing an input, adding a chart or removing an EA at home does nothing on the server until you migrate again.
  5. On a self-managed VPS, put MT5 in the Windows startup folder, set Windows Update to restart outside trading hours, and turn off sleep.
  6. Check the logs weekly. The Journal and Experts tabs (or the hosting log) show disconnects, rejected orders and restarts.

Running several EAs on one VPS is fine, but they share one account balance. Give each a different magic number and add up the open risk of all of them, not just one; see running multiple EAs on one MT5 account.

Honest risk note. A VPS keeps an EA running; it does not make the strategy profitable. A losing EA on a perfect server is still a losing EA, and a server can also fail, so every order should carry its own stop loss. Prices and terms of hosting change; the figures here are examples. Past and backtested results do not guarantee future results, and nothing in this guide is a trade recommendation.

Key takeaways

  • An EA stops when MT5 closes; server-side stop loss and take profit stay, trailing stops and time exits do not.
  • A PC that is off 8 hours a night misses about 35% of gold's trading day; session EAs feel this most.
  • Latency matters in proportion to the stop: small for H1 swing EAs, large for M1 scalpers.
  • Compare the fee with account size: 15 USD a month is 18% a year on 1,000 USD but 1.8% on 10,000 USD.

FAQ

Do I need a VPS to run an EA in MT5?

Not always. You need MT5 open and connected during the hours the EA trades. If your PC can stay on and online through those hours, it works the same way. A VPS helps when the EA trades while you sleep, needs to manage trades with trailing stops or time exits, or when your home connection is unreliable.

Does my stop loss still work if MT5 is closed?

Yes, if the stop loss was attached to the order. It is stored on the broker's server and executes without your terminal. What does not work offline is anything the EA or terminal does on its own: trailing stops, break-even moves, time-based exits and daily loss limits.

What ping is good enough for a gold EA?

There is no single number. For an EA with stops of several dollars on XAUUSD, 100 ms or more is usually acceptable. For an M1 scalper with stops under 2 USD, lower is better because every cent of slippage is a large share of the risk. Check the ping shown in MT5's status bar and compare backtest fills with live fills.

Can I run the same EA on my PC and on the VPS at the same time?

Not on the same account and symbol. Both copies will see the same signal and can open two trades, doubling your risk. Run the live copy in one place only and keep the other with Algo Trading turned off.

How much RAM does an MT5 VPS need?

For one terminal with a few charts and EAs, 2 GB is usually enough, and 4 GB gives room for a second terminal. EAs that load long history or many symbols need more. Watch the memory use in Task Manager during the first week.

For education only, not investment advice. Trading gold and CFDs is high risk and you can lose your capital.