Home › Automation (EAs and bots) › What MQL5 is and what it's for if you trade with MT5
What MQL5 is and what it's for if you trade with MT5
What MQL5 is (and what it isn't)
MQL5 is the language used to program the tools that run inside MetaTrader 5: the expert advisors that trade on their own, the indicators that plot data and the utilities that automate terminal tasks. It is the language of the program, not a strategy: an expert advisor can be brilliant or a money-losing machine, and the language has no opinion on that.
Writing it is a programmer's craft. That craft is not taught here: here you learn to trade with judgement and to evaluate and use ready-made tools (including expert advisors and the local bridge we use to share markings). Anyone who wants to devote themselves to writing programs has the official documentation and specific development courses.
What can and cannot be delegated to a program
| Task | Is it automated? | Why |
|---|---|---|
| Calculating position size | Yes | It's arithmetic: risk divided by the distance to the stop and the point value |
| Placing and moving the stop | Yes | It's an order with written rules, with no interpretation |
| Not trading outside trading hours | Yes | It's a time condition |
| Recording each trade | Yes | You only have to write down what has already happened. |
| Deciding where the price is going | No | No one knows: that is why the expert only executes rules set in advance |
| Sticking to the plan when you feel like doing the opposite | No | That is discipline, and you train it in your head, not in the terminal |
An expert repeats without blinking what someone wrote: if the rule is bad, it will repeat it a thousand times. That is why position size and limits are calculated before automating anything.
How to evaluate a ready-made expert (without reading a single line of code)
- What rules it says it follows and whether they are written somewhere (if they cannot be read, there is nothing to evaluate).
- What instruments and times it is intended for, and in which it should not be used.
- How it calculates the lot and how much it risks per trade.
- Whether it enters with a stop from the outset or whether it places it 'when it hits'.
- What it does during losing streaks: whether it doubles, stops or alerts.
- Whether the backtest includes costs, spread and commission (without that, the result means nothing).
- Whether the author explains the limits of the program. Anyone who promises profitability is selling, not explaining.
- What the terminal journal says when it is not trading: most 'broken' tools are misconfigured.
The limits nobody tells you about
The terminal has to be open (there is no windowless mode), with the symbols loaded and the correct permissions; latency and spread affect the real result; a backtest does not certify the future; and a tool you do not understand cannot be switched off with good judgement the day it stops working. Before leaving it alone, it is worth checking the instrument contract on the broker's platform: tick, point value and market pauses.
Why we do not teach programming here
For transparency: the academy trains people to make decisions and manage risk, and to use tools built with judgement. Programming is another profession, and mixing it with trading training produces people who know how to write code and still lose money. What is taught here is how to measure, how to question a backtest and how to calculate how much you lose if the trade goes wrong.
Frequently asked questions
Do I need to know how to program to use an Expert Advisor in MT5?
No. You need to understand what it does, how much it risks and under what conditions it should be used. Installing and configuring is not programming; writing the program is, and that is another trade.
Is MQL5 suitable for trading synthetic indices?
It works for any instrument the broker offers on MetaTrader 5, including synthetic indices, provided the symbols are loaded. What determines the result is not the language, but the rules and the size of each trade.
Can I trust an Expert Advisor because the backtest looks good?
Not for that reason. A backtest is an experiment on the past, and it is enough to change the period or add the real costs for the result to change. Use it to rule out ideas, never as a promise.
Automating what already works
At the academy, expert advisors are used for what risk demands: calculating size, placing stops and respecting limits. Never to guess the market.
Keep reading
- EAs and bots for MT5: what they are and how to use them
- Copying trades between MT5: how it is really done
- Copy trading with MT5: how to copy trades
- How an EA works internally | MetaTrader 5