How to Move Your MT4 or MT5 Expert Advisor to a VPS, Step by Step

How to Move Your MT4 or MT5 Expert Advisor to a VPS, Step by Step

Moving an expert advisor from your PC to a VPS takes about twenty minutes. Most problems afterwards come from three steps that are easy to skip:

  • copying every file the EA needs
  • turning algo trading back on, on the server
  • switching the EA off at home

This walkthrough covers MT4 and MT5.

Before you start

  • Your trading account number, password and the exact broker server name. You can find these in the terminal under File, Login to Trade Account.
  • The EA file: .ex4 for MT4 or .ex5 for MT5. Also any indicators, libraries, DLLs or set files it uses.
  • The EA's input settings. Save them as a .set file from the EA's Inputs tab so you do not retype them.
  • A VPS with the terminal installed. On our MetaTrader VPS it is already installed.

Step 1: collect the files from your PC

In your local terminal open File, Open Data Folder. The EA lives in MQL4\Experts (MT4) or MQL5\Experts (MT5). Also copy anything it depends on:

  • Indicators: custom indicators the EA calls.
  • Libraries: DLL and library files.
  • Files: data or licence files some EAs read.
  • Your saved .set files.

A missing indicator is the most common reason an EA loads on the VPS but never opens a trade.

Step 2: copy them to the same folders on the VPS

On the VPS, open the terminal's data folder the same way and paste each file into the matching folder. Then right-click Expert Advisors in the Navigator and choose Refresh, or restart the terminal. If you use a managed panel, upload the files there instead.

Step 3: log in to your trading account

Use File, Login to Trade Account with the same account number, password and server. Tick "save password" so the terminal can reconnect by itself after a restart. Look at the connection status in the bottom-right corner. It should show a ping time, not "No connection".

Step 4: set the terminal options

Open Tools, Options, Expert Advisors and make it match your PC:

  • Allow algorithmic trading.
  • Allow DLL imports, only if your EA needs them.
  • Allow WebRequest for listed URLs, if the EA calls a web service, and add every URL the EA uses.

Step 5: attach the EA and load your settings

Open the chart with the same symbol and timeframe you used at home and drag the EA onto it. On the Inputs tab, click Load to apply your .set file. Confirm, then press AutoTrading (MT4) or Algo Trading (MT5) in the toolbar. The EA icon in the chart corner should show it is active.

Step 6: switch the EA off at home

This is the step that costs money when skipped. Suppose the same EA runs on your PC and on the VPS against the same account. Both copies trade, and you get duplicate positions. Remove the EA from the chart on your PC, or close the local terminal.

Step 7: check that it is really running

  • The Experts tab should show the EA loaded with no errors.
  • The Journal tab should show a successful login.
  • Wait for the first trade signal, or test the whole setup on a demo account first.

If the EA loads but does not trade, work through why an EA stops trading on a VPS. Leaving Remote Desktop the wrong way can also stop MT4, so read why MT4 stops when you close RDP.

Make it survive a reboot

A VPS restarts now and then for updates. Make sure the terminal starts again by itself, logs in and turns algo trading back on. Our auto-restart and auto-login guide shows how. On a Karizanta MetaTrader VPS this happens automatically, and Telegram alerts tell you if a terminal goes offline.

Frequently asked questions

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

Not on the same account. Both copies react to the same signals and you end up with duplicate positions. Run it in one place only, and keep the other terminal for watching the account.

Will my EA licence work on a VPS?

Most EAs are licensed per trading account, so they work anywhere the same account logs in. Some lock to a computer ID instead; ask the vendor to reset or move the licence before you switch.

Do I need to copy history data?

No. The terminal downloads price history from the broker after you log in. Open the chart and let it load for a minute before attaching the EA, especially for indicators that need long history.

Why does my EA show a sad face or not trade on the VPS?

Usually algo trading is off, DLL imports are not allowed, or an indicator file is missing. Check the Experts and Journal tabs for the exact error message.

Does closing Remote Desktop stop the EA?

Disconnecting does not, but signing out does, because it closes the terminal. Always close the RDP window with the X button, or use a panel that keeps terminals running outside your session.

Trading carries a high risk of loss. This article is about running software and is not trading or investment advice.

More MetaTrader VPS guides

Want your terminals running 24/7 without babysitting a PC? See Karizanta MetaTrader VPS plans: UK servers near London brokers, MT4 and MT5 ready, from $7/month.

Related reading

See MetaTrader VPS plans ← Back to blog