AI trading bots vs Expert Advisors in MT5: what is the difference?

Quick answer
An Expert Advisor (EA) is a program written in MQL4/MQL5 that runs inside MetaTrader and follows fixed rules each time a new price tick arrives. Some EAs use machine-learning models, and some tools use large language models (LLMs) like ChatGPT for analysis, but "AI" does not make a strategy profitable. Many "AI robots" sold online are just EAs or managed-account schemes with marketing on top. Judge any bot by what you can verify: readable rules, a realistic backtest on real ticks with costs, an out-of-sample forward test and your own demo results.
"AI robot", "neural EA", "GPT bot": the labels change every year. Underneath, most automated trading on MetaTrader is the same thing it has been for a long time, an Expert Advisor. This guide explains what an EA is, what genuinely uses AI, what is just marketing, and how to test any bot honestly before it touches real money.
Three different things people call "AI bots"
| Rule-based Expert Advisor | Machine-learning model or LLM tool | Marketing "AI robot" | |
|---|---|---|---|
| What it is | MQL4/MQL5 code with fixed rules, e.g. "buy when the 20 EMA crosses above the 50 EMA" | A model trained on data to classify or predict, or a chatbot used to analyse text and code | A product sold with promises of fixed or "guaranteed" returns |
| Where it runs | Inside MT4/MT5 on your chart | Often outside MT5 (Python, cloud); results can feed an EA | Often on the seller's platform, or "they trade for you" |
| Can you inspect it? | Yes, if you have the source code; you can always test the compiled file | Partly. Learned models are hard to explain. | Usually not |
| Main risk | Overfitting, bad risk settings | Overfitting, data leakage, confident wrong answers | Loss of your whole deposit to a scheme |
What an Expert Advisor really is
MQL4 is MetaQuotes' built-in language for MT4; with it "you can create your own Expert Advisors that make trading management automated", as well as custom indicators and scripts.[1] MQL5 does the same for MT5. An EA is attached to a chart and its OnTick() function runs when a new tick arrives for that chart's symbol. Scripts and indicators do not receive this event.[2]
That is the key point: an EA does exactly what its code says, every time. If the rules are poor, the EA follows poor rules quickly and without emotion. Automation removes hesitation, not risk.
Where real AI fits in
- Machine-learning models can be trained to classify market conditions (for example trending vs ranging) and used as one input to an EA. They need careful separation of training and test data.
- LLMs such as ChatGPT are useful for explaining MQL code, drafting code you then review, and summarising news or your journal. OpenAI warns they can produce incorrect output with high confidence, so generated code must be read and tested.[7] See how to use ChatGPT for chart analysis.
- Neither removes market risk, spread, slippage or the need for a stop loss.
Why backtests mislead: overfitting, spread and slippage
Overfitting (curve-fitting)
If you optimise enough parameters over the same history, you will find a combination that looks wonderful on that history. It has learned the noise, not the market. MT5's Strategy Tester includes a Forward option for exactly this reason: it splits your date range, optimises on the first part and checks the selected parameters on the later part, "to avoid fitting to certain time intervals".[3][4]
Test quality
The tester offers several tick generation modes. "Every tick based on real ticks" uses real ticks accumulated by brokers and "provides conditions close to real ones". "1 minute OHLC" emulates only four prices per minute bar, and "Open prices only" is rougher still.[3] A scalping EA tested on rough data can look profitable when it is not.
Costs and execution
Live trades pay the spread, and they can fill at a worse price than requested. Spread on gold can widen sharply around news and at session changes, and stop orders fill at the next available price in a fast market. MT5's tester can emulate network delays to get closer to real conditions.[3] Remember too that a buy position's stop is checked against the Bid and a sell position's against the Ask.[5] Our stop loss and take profit guide explains why this matters on XAUUSD.
A checklist for evaluating any bot or EA
- Can you state its rules in one paragraph? If the seller cannot, walk away.
- Does it use a stop loss and a fixed risk per trade? Martingale or "averaging down" without a stop can look smooth until one bad move wipes the account. See the 1% risk rule.
- Test it yourself in the MT5 Strategy Tester on real ticks over several years, including volatile periods.[3]
- Forward-test on a period not used for optimisation, then run it on a demo account for weeks.[4]
- Compare results after costs to the seller's claims. Treat screenshots of profits as marketing, not evidence.
- Check the seller on the SC Investor Alert List. It includes entries such as "Robot AI Trading" (2022) and "TXN Bot" (2023), both listed for unlicensed fund management.[6]
Bottom line
An EA is a tool, like a calculator. It can apply good risk rules consistently, and it can apply bad rules consistently. The word "AI" on the box changes nothing about that. If a product promises fixed returns, read AI trading scams to avoid before anything else, and explore the AI-assisted trading and MetaTrader sections.
Frequently asked questions
Is an Expert Advisor the same as an AI trading bot?
Not necessarily. An Expert Advisor is any automated program for MetaTrader written in MQL4 or MQL5. Most follow fixed rules written by a person. A bot is "AI" only if it uses a learned model, and even then that says nothing about whether it makes money.
Can ChatGPT write an Expert Advisor for me?
It can draft MQL code and explain it, but OpenAI warns its output can be wrong. Compile and read the code yourself, test it in the Strategy Tester and on a demo account, and never run untested code on a live account.
Why do EAs that backtest well lose money live?
Common reasons are overfitting (parameters tuned to past noise), unrealistic test settings that ignore real spread, slippage and delays, and market conditions that change. Forward testing on a period not used for optimisation helps reveal this.
Which tick mode should I use in the MT5 Strategy Tester?
MetaTrader's help describes "Every tick based on real ticks" as providing conditions close to real ones, using real ticks accumulated by brokers. Faster modes such as 1 minute OHLC or Open prices only are rougher approximations.
Is it legal to buy an AI robot that trades my money for a monthly return?
Be very careful. The SC Investor Alert List includes entities named as "robot" or "AI" trading schemes carrying on unlicensed fund management. Managing other people's money requires a licence in Malaysia. Check the SC lists first.
Sources
- MQL4 Reference: introduction (Expert Advisors, indicators, scripts)
- MQL5 Reference: Event Handling Functions (OnTick for Expert Advisors)
- MetaTrader 5 Help: Strategy Testing (tick generation modes, forward testing, delays)
- MetaTrader 5 Help: Strategy Optimization
- MetaTrader 5 Help: Trading principles, order types, Stop Loss and Take Profit
- Securities Commission Malaysia: Investor Alert List
- OpenAI Help Center: Does ChatGPT tell the truth?
Sources were checked on the date shown above. Broker pages, where cited, are examples of published specifications only, not recommendations. Regulator lists change often, so always check the official portal directly.