Automated trading bot for MetaTrader 4

An MT4 trading bot places and manages trades inside MetaTrader 4 using a defined strategy. XAUBOT builds the bot for you as a ready-to-install .ex4 file, so you can automate gold and forex on the terminal almost every broker supports, without writing code or watching the charts all day.

Order routing on MT4

Live
◆Signal
⚙MT4 core
↗Broker
0ms

Signal to filled order, compiled MQL4 execution

.ex4native build
90%modelling quality
24/7coverage
9
Built-in timeframes
32-bit
Terminal architecture
MQL4
Programming language
4
Pending order types

What Is MetaTrader 4 (MT4)?

MetaTrader 4, also known as MT4, is a trading platform released by MetaQuotes in 2005. It remains the most widely offered retail trading terminal, and it is still the default choice at most forex brokers.

Supported almost everywhere

Nearly every retail broker offers an MT4 account, so you rarely have to change broker to run a bot.

9 built-in timeframes

M1 through to monthly charts, covering every timeframe a standard strategy needs.

Hedging by default

Every MT4 account allows opposite positions on the same symbol, so grid and recovery logic behaves predictably.

Runs on minimal hardware

The terminal is light on CPU and RAM, which keeps monthly VPS costs down when a bot runs around the clock.

How does it works – Step by Step

01

Select a market

Open the Market Watch panel and choose the instrument you want to trade, such as EUR/USD, GBP/JPY or XAU/USD.

02

Open a chart

Right-click your preferred currency pair and select Chart Window. You can then change the timeframe, add indicators, and use drawing tools for analysis.

03

Attach the bot

Drag your .ex4 file from the Navigator onto the chart, switch AutoTrading on, and let it manage the trading process for you. You can also trade manually: pick your lot size and set your Stop Loss and Take Profit levels.

04

Review your results

Open the Account History tab to review your previous trades, including profits and losses. This can help you evaluate your trading approach and make adjustments over time.

MT4 vs MT5: what changes for your bot

XAUBOT supports both, and which one you use usually comes down to your broker, the markets you want to trade, and your hardware.

Feature MetaTrader 4 MetaTrader 5 Impact on your XAUBOT
Broker availability Offered by almost every retail broker Widely offered, but not everywhere MT4You can usually keep the broker and account you already have.
Order management Hedging on every account Hedging or netting, set by the broker MT4No account-mode surprises for strategies that scale into a position.
Programming core MQL4 — lightweight, stable, simple MQL5 — object-oriented, high-speed MT4Lower CPU and RAM use. MT5Supports more complex logic.
Market access Forex, gold, indices Forex, gold, indices, stocks, crypto MT5Needed only if you want to automate stocks, indices or crypto.
Timeframes 9 standard 21, including 2m, 3m, 12m MT5Only matters for scalping on non-standard intervals.
Pending orders 4 types 6 types, adding stop-limit orders MT5Extra entry types for more complex order logic.
Backtesting precision Up to 90% modelling quality from M1 data Real-tick data simulation MT5Closer to live conditions. Forward-test on demo either way.

XAUBOT as your MT4 trading bot

XAUBOT is an automated trading platform that offers MT4 expert advisors (EA), and also provides customisation of trading bots based on trading styles and preferences

Works with any MT4 broker Customizable risk settings Verified live results
Start Free Trial

Every XAUBOT bot runs on MetaTrader 4

Build your own bot

Set the settings yourself and let XAUBOT compile it into a working bot file.

  • ✓Choose the market, strategy and risk settings that suit how you trade.
  • ✓No coding. The builder compiles the strategy for you.
  • ✓Download it for MT4 or MT5, whichever platform you already use.
Build your bot

Use the ready-made bots

Choose from the popular ready-made strategies, each supported by verified performance results.

  • ✓Download the whole bot files for MT4.
  • ✓Each bot is tuned to one market.
  • ✓Track records are published on Myfxbook, drawdown included.
Browse the bots

Questions?

Answers to the most common questions about MetaTrader 4 and running a bot on it.

Still have questions?

Our team answers via live chat and email — usually within 2 business hours.

Contact support →
Is MetaTrader 4 outdated now that MT5 exists?
No. MT5 is a separate product rather than an upgrade, and MT4 is still the terminal most retail brokers lead with. For forex and gold strategies it does everything a bot needs, and its lighter resource use is an advantage when a bot runs on a VPS all month.
Which file type does MT4 use?
MT4 runs .ex4 files. An .ex5 file is compiled for MT5 and will not load on MT4, so download the right build for your terminal.
Where do I put the .ex4 file?
In the MQL4/Experts folder of the terminal's data folder. Open it from the terminal with File → Open Data Folder, drop the file in, then restart MT4 or right-click Expert Advisors in the Navigator and choose Refresh.
Does MT4 support netting accounts?
No, and for most bots that is a benefit. Every MT4 account is hedging, so trades on the same symbol stay as separate tickets and a strategy that scales into a position behaves the same at every broker. On MT5 you have to check which mode the broker opened the account in.
What VPS specification does MT4 need?
A single-terminal setup runs comfortably on Windows Server 2016/2022 with 1–2 vCPU, 2 GB RAM, 20 GB SSD and under 100 ms latency to the broker server. Running several terminals, or backtesting while bots are live, needs more cores and RAM than that.
How does news filtering work without a built-in calendar?
MT4 has no economic calendar inside the terminal, so XAUBOT uses its own news filter service to pause trading around scheduled releases. That is why its WebRequest URL has to be allowed in Tools → Options → Expert Advisors before the filter will work.
My broker offers both MT4 and MT5 — does it matter which I pick?
For forex and gold, either works. Pick MT5 if you want to automate stocks or crypto, or need non-standard timeframes. Bots do not transfer between the two, so each terminal needs its own compiled file.
How can I tell a bot is actually running?
MT4 shows a blue Expert Advisor icon in the top-right corner of the chart when the bot is attached and Algo Trading is enabled. The Experts and Journal tabs log the startup lines, and the XAUBOT panel on the chart shows a Live status. .

Looking for the MetaTrader 5 details?

Explore MT5 requirements, timeframes, features, and how XAUBOT supports automated trading on MetaTrader 5

MetaTrader 5 overview →

Build a bot for your terminal

Generate an .ex4 file for MT4 or download a ready-made MT4 bot, test it on a demo account, and move to live trading only when you feel ready