Last month, I was running an EA on my desktop during a volatile NFP release. My internet dropped for exactly 47 seconds, and by the time it reconnected, the EA had missed two entry signals. That's when I finally caved and moved everything to a VPS.
The setup process itself is straightforward, but there are a handful of adjustments that make the difference between "it runs" and "it runs reliably without disconnecting."
Step 1: Pick the Right VPS Provider
Not all VPS providers are created equal for trading. You need low latency to your broker's servers and enough RAM to run your EAs. A standard 2 GB RAM server can comfortably handle 2 to 4 optimized MT4 terminals. If you're running multiple accounts or resource-heavy EAs, consider upgrading to 4 GB.
Step 2: Connect via Remote Desktop
After purchasing, the provider sends you an IP address, username, and password. Open Remote Desktop Connection on your computer, enter the IP, and log in. You're now inside a Windows environment that runs 24/7 in a data center somewhere.
Step 3: Install MT4 on the VPS
Download your broker's MT4 installer directly from the browser inside the VPS environment. Install it, log in with your trading account credentials. The platform now runs on the server, independent of your local machine.
Step 4: Upload Your EAs and Configure Settings
Copy your EA files into the
MQL4\Experts folder. In the terminal, make sure to enable "Allow automated trading" and "Allow DLL imports" if your EA requires it.Step 5: Configure Auto-Start for Reliability
This is where many traders slip up. If the VPS reboots for maintenance, your MT4 won't reopen by itself unless you set it up. To fix this:
shell:startup, and press Enter.Now MT4 will launch automatically every time the VPS restarts.
Step 6: Disable Windows Sleep and Power Saving
Windows Server has default power-saving settings that can suspend network activity and disconnect your trading session. I learned this the hard way when my EA went offline overnight for no apparent reason.
Run these commands in Command Prompt as administrator:
``
powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
powercfg /change standby-timeout-ac 0
powercfg /change disk-timeout-ac 0
powercfg /hibernate off
`
These commands activate the High Performance power plan, disable standby mode, stop the hard drive from powering down, and turn off hibernation.
Step 7: Disable Network Adapter Power Management
Windows can also shut down your network connection to save power. To prevent this, run PowerShell as administrator:
`
Disable-NetAdapterPowerManagement -Name "*" -Confirm:$false
`
This disables power management on all network adapters so your connection stays active.
Step 8: Adjust TCP Keepalive
During quiet market hours, your broker connection might drop if the session is idle. By default, Windows waits 2 hours before sending a keepalive packet. Change it to 5 minutes:
`
New-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\TcpIp\Parameters" -Name "KeepAliveTime" -PropertyType DWORD -Value 300000 -Force
``After running this command, reboot the VPS to apply the changes.
Step 9: Add Windows Defender Exclusions
Antivirus scans can interrupt MT4 performance or even quarantine EA files. Add your MT4 installation folder as an exclusion in Windows Security to prevent this.
Final Tip: Keeping the Session Alive
When you're done configuring and want to disconnect, don't close the Remote Desktop window by clicking the X. Instead, use the minimize button. This keeps your MT4 session running even after you disconnect, while closing the RDP window logs you out properly but doesn't shut down the apps.
Reference: MetaTrader 4 Help Center - Virtual Hosting (metatrader4.com); MQL5 VPS Documentation (mql5.com).
This article was originally published on FXEAR.com. All rights reserved. Unauthorized reproduction is prohibited.