How to automate MetaTrader 5 (MT5) trades
A plain-English guide to automating your MT5 account — what you need, how an Expert Advisor executes trades, and how to stay in control without handing over your broker login.
In short
To automate MetaTrader 5 you run an Expert Advisor (EA) on your terminal that places trades for you. With Diehard Trader, an AI trader decides and a cryptographically signed order is sent to your EA — so your broker login and funds never leave your own machine.
Automating MetaTrader 5 means letting software place trades in your account instead of you doing it by hand. The mechanics are simpler than they sound, and the part that matters most — staying in control of your account — is worth understanding before you start.
For the bigger picture — your options and the trade-offs — see the MetaTrader 5 automation guide. This post is the practical, step-by-step version.
What "automating MT5" actually means
MetaTrader 5 (MT5) can run an Expert Advisor (EA) — a small program attached to a chart that can place, modify, and close orders automatically. Automation is really just two questions:
- What decides when to trade?
- What executes the trade in your account?
Traditionally both lived inside one rigid EA following a fixed formula. A more flexible approach splits them: a reasoning layer decides, and a thin EA on your terminal executes. That's how Diehard Trader works — an autonomous AI trader makes the decision, and the EA only places what it's told.
What you need to get started
- An MT5 terminal logged into your broker. Any broker that offers MetaTrader 5 works — the EA places trades through your terminal, so if your terminal can connect, it works.
- The Expert Advisor on one chart, with "AutoTrading" enabled.
- Somewhere for the terminal to keep running. Your own PC is fine to start; a Windows VPS is better if you want it trading while your computer is off (more on that below).
You do not need TradingView, a Pine script, or any webhook plumbing. And to evaluate everything risk-free first, you don't even need MT5 — paper trading runs entirely in the cloud.
How orders reach your account
Here's the path a live order takes:
- The AI trader decides to enter (or exit) and forms its thesis.
- The decision is checked against your hard guardrails in code.
- A cryptographically signed (HMAC) order is sent to the EA on your terminal.
- The EA verifies the signature and places the trade with your broker.
Because the order is signed end to end and the EA refuses anything that isn't correctly signed, a forged or tampered order can't reach your account. The secret that signs orders is injected server-side and never handled by the AI itself.
Staying in control
This is the part people skip and shouldn't. With a well-designed setup:
- No one holds your funds or broker login. The EA runs on your terminal; the service is custody-free by design.
- You can stop instantly. A kill switch — or reverting a trader to paper — flattens the open position immediately.
- Hard limits are enforced in code: max risk per trade, max position size, a daily-loss limit, and a cap on open positions. The AI can't argue past them.
- Failed orders are logged. If your broker rejects an order (insufficient margin, market closed, unknown symbol), you see the exact reason.
Automation should expand what you can supervise, not remove you from the loop.
Do you need a VPS?
Not to try it — paper trading needs nothing but a browser. For live trading, a Windows VPS is recommended so your MT5 terminal and EA keep running 24/5 even when your own computer is asleep. If you only trade while your machine is on, you can skip it, but you'll miss trades that fire while it's off.
A note on expectations
Automating execution removes hesitation and human error from placing trades. It does not guarantee profit — that depends on the strategy and the market. The honest way to evaluate any automated setup is to run it on paper first, read the reasoning behind each decision, and judge it on a real forward track record before going live.
Frequently asked questions
Does MT5 automation work if my broker adds suffixes to symbols (like XAUUSD.c)? Yes. A good EA automatically matches the standard symbol to your broker's version, so you don't configure anything.
Can I run more than one automated strategy on the same MT5 account? Yes — each live trader gets its own routing number, so trades, P&L, and history stay cleanly separated (and separate from any manual trades you place).
Is MetaTrader 4 (MT4) supported? Diehard Trader works with MetaTrader 5 only.
Put an AI trader to work — on paper, today.
Describe a trader in plain English and watch it run, free. No card.