Running Expert Advisors 24/7: Complete VPS Guide

person
FXVPS
Share
Running Expert Advisors 24/7: Complete VPS Guide

Fiber optic cables with glowing connectors for low-latency trading

Expert Advisors are the number one reason forex traders get a VPS. Not faster execution, not copy trading, not news trading. EAs. If you search any forex forum for “VPS,” the thread is almost always about keeping an EA running overnight. This is the definitive guide to doing it properly.

Why EAs Need 24/7 Uptime

The forex market runs from Sunday at 5:00 PM Eastern to Friday at 5:00 PM Eastern. That is 120 hours of continuous trading every week. Your home PC cannot realistically stay online for 120 hours straight, week after week, without interruption.

Think about what goes wrong. A power outage at 3:00 AM kills your PC. Your EA stops. Your three open positions sit in the market with no management. The trailing stop your EA was adjusting every 30 seconds? Frozen at whatever level it was when the power died. Your internet drops for 20 minutes during London open. Same result. Windows decides to restart for an update while you’re sleeping. Same result.

Each of these scenarios means the same thing: your EA is offline, your positions are live, and nobody is managing them. The stop loss you set when the trade opened still exists, but any dynamic management your EA performs — adjusting stops, closing partials, adding to winners — all of that stops.

A VPS runs on enterprise-grade hardware with redundant power, battery backup, and diesel generators. FXVPS datacenters in London (LD4), New York (NY4), Tokyo (TY3), and Hong Kong (HK1) maintain 99.99% uptime. Your EA keeps running even when everything at your house goes dark.

⚠️ Warning: A home PC averages 5-15 hours of unplanned downtime per year from power outages, ISP issues, and forced restarts. One outage during open positions can cost more than years of VPS service.

Setting Up EAs on VPS: Complete Walkthrough

Connect to your VPS via Remote Desktop and follow these steps.

Step 1: Install MT4 or MT5

Download the installer from your broker’s website. Run it on the VPS. Log in with your trading account credentials. Let it download history data — first launch takes a few minutes.

Step 2: Copy EA Files

Your EA files end in .ex4 (MT4) or .ex5 (MT5). Place them in the correct directory:

  • MT4: Open MT4, click File, then Open Data Folder. Navigate to MQL4/Experts/ and paste your .ex4 file there.
  • MT5: Same process but navigate to MQL5/Experts/ and paste the .ex5 file.

Step 3: Refresh the Navigator

Back in MetaTrader, find the Navigator panel on the left side. Right-click on “Expert Advisors” and select Refresh. Your EA should appear in the list. If it doesn’t, restart MetaTrader entirely.

Step 4: Drag EA onto Chart

Open the chart for the pair and timeframe your EA requires. Drag the EA from the Navigator onto the chart. The EA properties window opens.

Step 5: Configure EA Settings

In the Inputs tab, set your EA’s parameters — lot size, stop loss, take profit, and any strategy-specific values. These settings are unique to each EA, so refer to its documentation.

Step 6: Enable AutoTrading

Click the AutoTrading button in the MetaTrader toolbar. It must display a green icon. If it shows red, your EA is loaded but cannot place trades. This is the single most common mistake traders make on a new VPS setup.

Step 7: Verify the EA Is Running

Check the top-right corner of your chart. A smiley face means the EA is active and able to trade. A frowning or gray face means something is wrong. Also check the Experts tab at the bottom of MetaTrader for initialization messages or errors.

Critical Settings Most Traders Miss

Beyond the EA itself, two platform-level settings must be correct.

Go to Tools, then Options, then the Expert Advisors tab. Confirm “Allow automated trading” is checked. This is a master switch. If it is off, no EA on any chart can trade, regardless of per-chart settings.

Best Practice: Enable both the AutoTrading button (green play icon in toolbar) and “Allow automated trading” in Tools > Options > Expert Advisors. Both must be active for EAs to execute trades after a restart.

The “Allow DLL imports” option should only be checked if your specific EA requires it. Enabling DLL imports for an EA that doesn’t need them is a security risk. If you’re unsure, leave it off — your EA will tell you if it needs DLLs by showing an error in the Experts tab.

For each chart, you can also check the per-chart EA setting: right-click the chart, select Expert Advisors, then Properties, and verify the Common tab has “Allow automated trading” checked.

Auto-Recovery After VPS Reboot

VPS reboots are rare but they happen. Planned maintenance, security patches, or the occasional unexpected restart. Your EA should survive this automatically.

Add MetaTrader to Windows Startup

Press Win + R, type shell:startup, press Enter. This opens the Startup folder. Create a shortcut to your MT4 or MT5 executable and place it here. Now MetaTrader launches automatically when Windows starts.

Best Practice: Place MT4/MT5 shortcuts in the Windows Startup folder (Win+R, type shell:startup) so your terminals and EAs restart automatically after any VPS reboot.

MetaTrader remembers your chart layout, attached EAs, and settings. After a restart, it reconnects to the broker and reloads everything.

Test This Before You Trust It

Not all EAs resume correctly after a restart. Some EAs store trade state in memory variables that don’t persist across restarts. The EA might not recognize its own open positions, or it might open duplicate trades because it thinks no position exists.

Test it yourself. Reboot your VPS intentionally during the weekend when markets are closed. After it comes back up, verify: Did MetaTrader start? Is the EA attached to the chart? Is the smiley face showing? Does the EA recognize positions from before the reboot? If any of these fail, contact your EA’s developer about restart persistence.

Best Practice: Schedule all VPS maintenance and Windows updates for Saturday or Sunday when forex markets are closed. Never apply updates during active trading hours.

Close-up of network cables plugged into a high-speed switch

Monitoring EAs Remotely

Mobile RDP

Install the Microsoft Remote Desktop app on your iPhone or Android. Save your VPS connection details. You can check your charts from anywhere — during lunch, before bed, on vacation. A quick glance confirms the EA is running and positions look normal.

Email Alerts

MetaTrader supports email notifications. Go to Tools, then Options, then the Email tab. Configure your SMTP server (Gmail works). You can set up alerts for trade opens, closes, or errors. Some EAs send emails automatically; others need you to add an alert via the terminal.

Trade History Checks

Review your account’s trade history daily. If your EA should place 2-3 trades per day and the history shows zero for the past 24 hours, something is wrong. Compare actual trades against what the EA’s strategy should produce in current market conditions.

Common EA Problems on VPS

”Trade context busy”

Two EAs are trying to send orders on the same account simultaneously. MetaTrader processes one trade request at a time. If EA #1 is placing a trade, EA #2 gets this error. The fix: use EAs that implement trade context checking with a retry loop, or stagger EAs on different magic numbers and accounts.

”Not enough money”

Your free margin is insufficient for the trade size. Either reduce the lot size in EA settings or deposit additional funds. This error appears frequently when grid or martingale EAs try to open additional positions in a drawdown cycle.

”Invalid stops”

The stop loss or take profit is too close to the current price. Every broker has a minimum stop distance (the “stops level”). Check your broker’s contract specifications for the pair and adjust your EA’s stop distance accordingly.

EA Shows Red or Gray Face

AutoTrading is globally disabled (check the toolbar button), or the EA hit a DLL error during initialization, or the EA’s OnInit() function returned an error. Check the Experts tab at the bottom of MetaTrader for the specific error message.

Choosing the Right VPS Plan

Not all EAs consume the same resources. A simple moving average crossover uses almost no CPU. A neural network EA running real-time optimization uses significant CPU and RAM.

Lite Plan ($4.99/mo): 1-2 simple EAs on one MetaTrader terminal. Basic strategies like indicator crossovers or time-based entries.

Standard Plan ($9.99/mo): 3-5 EAs or multiple strategies on one terminal. Enough headroom for EAs that scan multiple pairs.

Pro Plan ($19.99/mo): Heavy computation EAs — neural networks, real-time multi-pair scanning, or optimization alongside live trading. Also the right choice if you run multiple MetaTrader terminals simultaneously.

Elite Plan ($29.99/mo): Professional setups with 6+ terminals, custom indicators pulling external data, or EAs that require maximum CPU and RAM.

For tips on squeezing better performance out of MetaTrader itself, read our guide on enhancing MT4/MT5 performance with forex VPS integration.

Stop Gambling With Your Home PC

Every hour your EA runs on a home computer is an hour of unnecessary risk. A single power outage during a volatile session can cost more than an entire year of VPS hosting. FXVPS runs your Expert Advisors on dedicated infrastructure with datacenter locations positioned next to major broker servers, delivering execution speeds as low as 0.38ms across 195+ supported brokers.

Check our plans and move your EAs to infrastructure that matches the seriousness of your trading.