XAUUSD Robot

Updated 2026-07-12 · 7 min read

How to Set Up a XAUUSD Robot on MT4 & MT5: Step-by-Step Guide for Beginners

Installing a XAUUSD robot for the first time can feel intimidating, but the process is genuinely simple once you've seen it laid out. This guide walks you through every step in the correct, safe order.

We'll cover MetaTrader 4 (MT4) and MetaTrader 5 (MT5), since the steps are nearly identical on both.

What You'll Need Before You Start

Optional but recommended for live trading: a VPS so your robot runs 24/5 even when your computer is off.

Step 1: Open and Fund a Compatible Account

Choose a regulated broker that supports algorithmic trading and offers competitive spreads on gold. Open a demo account first; it uses virtual money but real market prices, which is exactly what you need for testing.

Step 2: Install the MetaTrader Platform

Download MT4 or MT5 from your broker and install it. Log in with your credentials, selecting the demo server for now.

Step 3: Add the Robot File to MetaTrader

  1. In MetaTrader, click File → Open Data Folder.
  2. Open the MQL4 folder (MT4) or MQL5 folder (MT5).
  3. Open the Experts subfolder.
  4. Copy your robot's .ex4 or .ex5 file into this Experts folder.
  5. Back in MetaTrader, right-click Expert Advisors in the Navigator and choose Refresh.

Your XAUUSD robot should now appear in the Navigator list.

Step 4: Enable Automated Trading

  1. Go to Tools → Options → Expert Advisors.
  2. Tick Allow Algo Trading (and "Allow WebRequest" if the robot needs external data).
  3. Click the Algo Trading button in the toolbar so it turns green.

If this button is red, no robot will trade. This is the number-one reason beginners think their EA is broken.

Step 5: Attach the Robot to the Gold Chart

  1. Open a XAUUSD chart.
  2. Set the timeframe your robot recommends (for example M5 or M15).
  3. Drag the robot from the Navigator onto the chart.
  4. Load the recommended .set file if one was provided, then confirm your inputs.
  5. Make sure "Allow Algo Trading" is ticked in the Common tab, and click OK.

A small smiley face in the top-right corner of the chart means the robot is active.

Step 6: Backtest Before Trusting It

In MetaTrader's Strategy Tester, select your robot, XAUUSD, and the recommended timeframe. Choose a date range that includes both trending and choppy markets, use high-quality tick data, and run the test.

Look beyond the profit number. Pay attention to maximum drawdown, the profit factor, and how the equity curve looks. A smooth, gradual curve is healthier than a jagged one that spikes and crashes.

Step 7: Run It on Demo for Several Weeks

A backtest shows the past; a demo run shows how the robot handles live conditions — real spreads, slippage, and execution delays. Let it trade on demo for at least two to four weeks and confirm the live behaviour roughly matches the backtest before risking a cent.

Step 8: Go Live — Carefully

Common Setup Mistakes to Avoid

New to gold robots?

Start with our complete guide to how automated XAUUSD trading works before you go live.

Read the Complete Guide →

Frequently Asked Questions

How do I know if my XAUUSD robot is working?

Look for the smiley face in the top-right of the chart and a green Algo Trading button in the toolbar. You can also check the Experts and Journal tabs at the bottom of the platform for the robot's log messages.

Can I run the robot on multiple charts?

It depends on the robot. Some are designed for a single XAUUSD chart; others support multiple pairs. Check the manual, since running two conflicting instances on one account can cause problems.

Do I really need a VPS?

For serious live trading, yes. A VPS keeps the robot running 24/5 with a stable connection close to the broker's servers, which reduces slippage and prevents missed trades.

Why isn't my robot placing any trades?

The most common causes are Algo Trading being disabled, market conditions not yet matching the robot's entry rules, the spread being too high for a scalping robot, or being outside the robot's allowed trading hours.

Is MT4 or MT5 better for a gold robot?

Both are excellent. Use whichever your robot and broker support. MT5 offers more features and instruments; MT4 remains extremely popular and well-supported.

Disclaimer: This article is for educational purposes only and is not investment or financial advice. Trading gold (XAUUSD) and other CFDs involves substantial risk of loss and is not suitable for every investor. Past performance and backtested results do not guarantee future results. Always test on a demo account and only trade with capital you can afford to lose.