MetaTrader 5 automation: the complete guide
A complete, plain-English guide to automating MetaTrader 5 — what automation really is, the decision-vs-execution split, your options, and how to automate while staying fully in control of your account.
In short
Automating MetaTrader 5 means letting software decide and/or execute trades through an Expert Advisor on your terminal. The three choices that matter are what does the deciding, what does the executing, and how you keep control. This guide maps the landscape and the trade-offs.
MetaTrader 5 (MT5) is one of the most widely supported trading platforms in the world, and almost all of it can be automated. This guide is the map: what "automating MT5" actually means, the options you have, and — the part most guides skip — how to automate without losing control of your own account.
If you just want the click-by-click steps, jump to how to automate MetaTrader 5 trades. This page is the bigger picture.
What MetaTrader 5 automation actually is
At its core, MT5 automation is running an Expert Advisor (EA) — a program attached to a chart that can place, modify, and close orders on its own. Once an EA is running and AutoTrading is on, your terminal can trade without you clicking anything.
But "automation" hides two separate jobs, and conflating them is where most confusion comes from.
The two halves: deciding vs executing
Every automated trade involves two distinct things:
- Deciding — what to trade and when. This is the strategy: the logic that turns market data into "buy", "sell", or "wait".
- Executing — actually placing that order in your account through MT5.
Traditionally both lived inside one EA: a fixed formula that both decided and executed. A more flexible modern approach splits them — a smarter reasoning layer decides, and a thin EA on your terminal only executes what it's told. That separation is how autonomous AI trading works: the AI forms a thesis and decides; the EA just places the signed order.
Why the split matters: it lets the "deciding" part be as sophisticated as you like (and run in the cloud) while the "executing" part stays simple, local, and under your control.
Your options for automating MT5
There's a spectrum, from rigid to reasoned:
- Rule-based EAs — a fixed strategy coded in MQL5. Predictable, but blind to anything outside its rules, and a pain to adapt.
- Marketplace robots — pre-built EAs you buy or rent. Convenient, but you often can't see why they trade, and many are tuned to flatter a backtest.
- Custom-coded EAs — you (or a developer) write the exact logic. Maximum control, maximum effort, and you own the maintenance.
- AI trading agents — a reasoning layer decides in plain language and explains each call, while the EA executes. More adaptable and transparent, provided the guardrails are real.
No option is automatically "best" — see how to choose an MT5 trading bot for the criteria that actually matter.
What you need to run it
- An MT5 terminal logged into a broker (any broker offering MetaTrader 5 works — the EA trades through your terminal).
- An Expert Advisor on one chart, with AutoTrading enabled.
- Somewhere for the terminal to keep running — your PC to start, or a Windows VPS so it trades while your computer is off.
To evaluate a strategy first, you don't need any of this — paper trading runs in the cloud with no terminal at all.
Staying in control (the part that matters most)
Automation should expand what you can supervise, not remove you from the loop. A well-designed setup keeps these in your hands:
- Custody. No one should hold your funds or broker login — the EA runs on your terminal. This is custody-free automation, and it's a non-negotiable.
- Hard guardrails enforced in code — max risk per trade, max position size, a daily-loss limit, a cap on open positions. Limits the strategy cannot argue past.
- A kill switch — the ability to stop instantly and flatten open positions.
- Visibility — knowing why each trade happened, and seeing rejected orders with the broker's reason.
If an automation setup can't give you these, that's the story, not a footnote.
Paper first, live on your terms
The safe path is always the same: run on paper (a simulator on real market data, no money at risk) until you trust the behaviour, then flip to live deliberately, per strategy. Going live should be reversible — you can revert to paper or kill it at any time.
Common questions
Do I need to know how to code to automate MT5? No. You can run pre-built EAs, or use an AI trader you describe in plain English. Coding is only needed if you want to write custom MQL5 logic yourself.
Is MetaTrader 5 automation safe? The automation itself is as safe as the control you keep — custody, guardrails, and a kill switch. The strategy still carries market risk; automation doesn't remove that.
What's the difference between MT4 and MT5 automation? The concepts are the same, but the languages and EAs differ (MQL4 vs MQL5). Diehard Trader works with MetaTrader 5 only.
Ready to try it without risking anything? Build an AI trader and run it on paper, free — then connect MT5 when you're ready to go live.
Put an AI trader to work — on paper, today.
Describe a trader in plain English and watch it run, free. No card.