An automated trading system, often called a trading bot or robot, is software that places, manages and closes trades by following a fixed set of rules. You decide the rules in advance, and the program carries them out. On the popular MetaTrader platforms these programs are called Expert Advisors, or EAs. Other platforms use other names, but the idea is the same.
What it is, and what it goes by
Different platforms use different words for the same idea:
- MetaTrader 4 and 5: Expert Advisors (EAs), written in the MQL4 or MQL5 languages.
- cTrader: cBots, usually written in C#.
- TradingView: strategies written in Pine Script, which can send alerts that other tools may turn into orders.
- Your own code: programs written in languages such as Python that talk to a broker through its programming interface (API), when the broker offers one.
In this lesson, "EA" and "bot" mean the same thing. If you prefer to understand the wider world of algorithmic trading first, including what banks and funds do, see algorithmic and high-frequency trading: where you fit.
How it works: a loop, not a mind
An EA does not look at a chart the way you do. It runs a short loop again and again, every time the price updates:
The loop an EA repeats, tick after tick
What you are seeing: an EA is a loop. Each time the price updates, it checks the rules it was given, checks its risk limits, and either places an order or does nothing. It never gets bored or tired, and it never uses judgment either.
- A new price arrives from the broker.
- It checks its rules. For example: "if the 20-period average crosses above the 50-period average, that is a buy signal."
- It checks its risk limits. How big should the position be? Is the daily loss cap already used up?
- It acts, by sending an order, moving a stop, closing a trade, or simply waiting.
That is all. It has no hunches and does not notice that today feels different. If the rules did not foresee a situation, the bot will still follow them.
The main types of bots
- Trend-following: enters when price keeps moving in one direction. Often wins less than half its trades, but tries to make the winners larger than the losers.
- Range or mean-reversion: bets that price will return toward an average after stretching away from it. It tends to win often, but a single strong trend can cause a large loss.
- Breakout and news bots: trade when price leaves a range or around scheduled events. They are sensitive to slippage and spread widening.
- Scalpers: take very small gains many times a day. Costs such as spread and commission can decide whether they work at all.
- Grid and martingale bots: keep adding trades, or bigger trades, against the market. They can look excellent for a long time and carry the most dangerous kind of risk. See martingale, grid and averaging down for the detail.
Copy trading and signal services are different. There, you follow another person's trades, and you cannot see or control their rules.
What it needs to run
- A trading platform that supports automation, with automated trading switched on.
- A constant connection. If the computer sleeps or the internet drops, the bot stops, and any open trades keep running without it. Many people rent a virtual private server (VPS), which is a remote computer that stays on, for this reason.
- A broker whose rules allow automated trading. Most do, but terms differ, so read yours.
What a bot is not
A bot is not a money machine, and it is not "AI that beats the market". It faces the same prices, spreads, leverage and risks as you do, and it can lose money as quickly as a person. What automation changes is who clicks the buttons, not whether the strategy has an edge. A bad strategy automated is just a bad strategy that runs faster.
A quick note on our role: Evenline does not sell, rent or endorse any EA, bot or signal service, and these lessons are education, not advice.