Blog  /  MT4 & MT5 EA Setup Guide

MT4 & MT5 EA Setup Guide — Install and Configure Your Expert Advisor

Published March 6, 2026 · 9 min read

An Expert Advisor (EA) is the backbone of automated trading on MetaTrader platforms. Whether you are running MT4 or the newer MT5, an EA is a program that connects to your broker, receives signals, and executes trades on your behalf — all without manual intervention. For AutoXAU subscribers, the EA is how our XAUUSD signals get translated into live (or demo) trades on your account.

This guide walks you through the entire process: downloading the EA, installing it on MetaTrader, configuring risk parameters, and verifying that everything works before you go live. No prior programming experience required.

📌 Key Takeaways

  • An MT4 EA is a compiled program (.ex4 or .ex5) that executes trades automatically based on signals.
  • Proper configuration of risk parameters (lot size, max drawdown, leverage) is critical before going live.
  • Always test on a demo account first — at least 1–2 weeks of paper trading is recommended.

Prerequisites

Before you begin, make sure you have the following ready:

  • MetaTrader 4 or MetaTrader 5 installed on your PC (or a VPS for 24/7 uptime).
  • A broker account that supports XAUUSD trading with EA execution enabled.
  • An active AutoXAU subscription (Starter, Pro, or Elite tier).
  • The AutoXAU EA file, downloadable from your subscriber dashboard after registration.

Installing the EA on MetaTrader 4

Step 1: Download the EA file

Log in to your AutoXAU dashboard and navigate to Downloads. Download the .ex4 file to your computer. Do not rename it.

Step 2: Open the MetaTrader data folder

In MT4, go to File → Open Data Folder. This opens the directory where MetaTrader stores its configuration and expert advisors.

Step 3: Copy the EA to the Experts folder

Navigate to MQL4/Experts/ and paste the downloaded .ex4 file into this directory. For MT5, the path is MQL5/Experts/.

Step 4: Restart MetaTrader and attach the EA

Close and reopen MetaTrader. In the Navigator panel (Ctrl+N), expand "Expert Advisors". You should see AutoXAU_EA. Drag it onto your XAUUSD chart.

Step 5: Enable automated trading

In the EA properties dialog, check "Allow live trading" and "Allow DLL imports". Also ensure the global AutoTrading button (top toolbar) is enabled — the icon should be green.

⚠️ Important

If the smiley face in the top-right corner of your chart is not smiling, the EA is not active. Check that AutoTrading is enabled globally and that "Allow live trading" is checked in the EA properties.

Configuring Risk Parameters

The EA settings panel contains several critical risk parameters. Getting these right is more important than the signal strategy itself — poor risk management can wipe an account even with a winning strategy.

  • Lot Size / Risk Per Trade — set this as a percentage of account equity (recommended: 1–2%). The EA can calculate lot size automatically based on stop-loss distance.
  • Maximum Daily Drawdown — the EA will stop trading if cumulative daily losses exceed this threshold (recommended: 3–5% of account).
  • Maximum Open Positions — limits the number of concurrent trades. For XAUUSD, 1–3 is typical.
  • Slippage Tolerance — maximum acceptable slippage in points. Set to 3–5 for gold on ECN brokers.
  • Trading Hours — optionally restrict trading to specific sessions (e.g., London + New York overlap).

📌 Key Takeaways

  • Risk per trade of 1–2% of equity is the industry standard for sustainable automated trading.
  • The daily drawdown limit is your safety net — set it before you need it.
  • VPS hosting ensures your EA runs 24/7 even when your PC is off.

MT5 Differences

MetaTrader 5 follows the same general process, with a few differences. The EA file extension is .ex5 instead of .ex4, and the folder path is MQL5/Experts/. MT5 also supports netting and hedging account modes — make sure your broker account is set to hedging mode if you want the EA to manage multiple positions independently. MT5 offers better multi-asset support, faster backtesting, and more order types, making it the preferred platform for traders who also want to automate forex pairs alongside gold.

Testing on Demo Before Going Live

This is non-negotiable. Before connecting the EA to a funded account, run it on a demo account for at least one to two weeks. Observe the following:

  • Are signals being received and executed correctly?
  • Are stop-loss and take-profit levels placed as expected?
  • Does the EA respect the daily drawdown limit?
  • Are there any disconnection issues between the EA and the signal server?

Only after you are confident the system behaves as expected should you move to a live account — and even then, start with conservative risk settings. You can always increase size later once you have a track record.

VPS Hosting for 24/7 Uptime

If your PC is not running 24/7, the EA will miss signals. The solution is a Virtual Private Server (VPS) — a remote Windows machine that stays online around the clock. Many forex VPS providers offer plans starting at $10–30/month with low-latency connections to major brokers. Once set up, you install MetaTrader and the EA on the VPS, and it runs independently of your local machine.

📌 Key Takeaways

  • A VPS eliminates the risk of missed signals due to PC downtime or internet outages.
  • Choose a VPS located near your broker's server for minimal latency.

Troubleshooting Common Issues

  • EA not trading — check AutoTrading is enabled, "Allow live trading" is checked, and the chart is on the correct symbol (XAUUSD).
  • Connection errors — verify your internet connection and that the signal server URL in the EA settings is correct.
  • Wrong lot sizes — double-check the risk percentage and ensure your account balance is sufficient for the calculated lot size.
  • "Trade context busy" — this means another EA or script is using the trade thread. Remove duplicate EAs from the same chart.

Setting up an MT4 EA is straightforward once you have done it once. The critical step is not the installation — it is configuring risk properly and testing thoroughly before committing real capital. Respect the process, and the automation will do the rest.

Ready to automate your trading?

Get the AutoXAU EA and start receiving signals on MT4 or MT5.

View Pricing →