About 80% of forex volume is executed by algorithms. If you trade retail, the version of that you'll actually use is called an EA — short for Expert Advisor. It's a program that runs on MetaTrader and trades for you based on rules you set.
That's it. That's the concept. Everything else is details.
So what does an EA actually do?
An EA is a small program that sits on your MT4 or MT5 chart. You give it rules — "buy when the 50 MA crosses above the 200 MA" or "open a sell if RSI goes above 80" — and it watches the market and executes those rules automatically. It places orders, sets stop losses, manages positions, and closes trades. You don't need to be at your screen.
Think of it as a trading robot, except "robot" oversells it. It's more like a very obedient assistant that does exactly what you tell it, nothing more. It won't adapt to changing conditions unless you programmed it to. It won't "figure things out." It follows instructions.
MetaTrader is still the dominant retail platform — over 90% of brokers support MT4, and MT5 overtook MT4 in volume for the first time in early 2025 (54.2% share per Finance Magnates). Both have built-in EA support.
How it works under the hood
Every time a new price tick comes in, the EA runs its logic:
- It reads the latest price data — candles, spreads, volume
- It checks your conditions against that data
- If conditions match, it sends an order to the broker
- It manages stop loss, take profit, and position sizing automatically
The programming language is MQL4 (for MT4) or MQL5 (for MT5). Syntax is similar to C. If you've coded before, you can pick it up in a weekend. If you haven't, there's a visual wizard in MT5 that lets you build basic EAs without writing code, and thousands of ready-made ones on the MQL5 market.
The core structure is three functions:
OnInit()— runs once when the EA loads. Set up your variables here.OnTick()— runs on every new price tick. This is where the trading logic lives.OnDeinit()— runs when you remove the EA. Cleanup goes here.
The main types of EAs
Trend followers ride momentum. They use moving averages, MACD, or Bollinger Bands to detect a direction and go with it. Great in trending markets, painful in choppy ones. Most beginners start here because the logic is intuitive — but the hard part is figuring out when the trend is actually over versus just pulling back.
Grid EAs place buy and sell orders at fixed intervals above and below the current price. They profit from oscillation. They blow up in strong trends. I've seen traders run grids on EURUSD during quiet summer months and do fine, then get wiped in September when volatility picks up.
Martingale EAs double down after losses, waiting for one winner to recover everything. The equity curve looks smooth until it doesn't. We work with Martingale logic in several of our EAs at FXTool, so here's what we've learned: the key is strict layer limits. You need to know the exact maximum number of positions, the lot size at each layer, and what account balance is needed to survive the worst-case drawdown. With those limits defined, it's a real position management method. Without them, it's just gambling with extra steps.
Scalpers grab tiny profits in seconds or minutes. They need low spreads, fast execution, and usually a VPS close to the broker's server. If your ping to the broker is over 20ms, scalping EAs will underperform.
Hedging EAs hold opposite positions on the same pair to reduce directional exposure. Complex logic, thin margins, and not supported by all brokers (US brokers generally prohibit hedging on the same account).
Breakout EAs wait for price to punch through support/resistance, then jump in. Low win rate, but the winners tend to be large. Our Candle Pattern Breakout EA uses a variant of this approach on daily charts.
Why people use EAs
No emotions. The EA doesn't panic-sell or hold a loser because "it might come back." It follows the rules you set, period. Anyone who's ever moved a stop loss "just this once" knows why this matters.
It doesn't sleep. Forex runs 24/5. You need sleep. The EA doesn't. Run it on a VPS and it watches the market around the clock.
It's fast. Order execution in milliseconds. For scalping strategies, this matters.
You can backtest before risking money. Run the EA against years of historical data to see how the strategy would have performed. MT4 and MT5 both have a built-in Strategy Tester. We have a full guide on backtesting if you want to go deep on this.
It can watch more pairs than you can. Running 10 EAs on 10 charts at the same time is trivial for a computer.
Where EAs fall short
Black swans will wreck them. A surprise rate decision, a geopolitical event, a flash crash — the EA's rules were built for normal conditions. During the SNB shock in January 2015, some accounts went negative in seconds. No EA was prepared for a 30% move in a major pair.
Overfitting is real. You can tweak parameters until the backtest looks incredible. Then it loses money in live trading because it memorized the past instead of learning the pattern. This is called curve fitting and it's the number one beginner mistake. We see it constantly — someone shows us a backtest with a 95% win rate and a perfect equity curve, and the strategy falls apart within two weeks of going live.
They need infrastructure. Stable internet, reliable VPS, a broker with decent execution. If any of those fail, trades get missed or botched.
Markets change. A strategy that crushed it in 2024's trending gold market may bleed in a range-bound environment. Most EAs run fixed rules and can't adapt on their own. You still need to decide when to pause, adjust, or switch.
Realistic returns matter. A solid EA typically delivers 12–60% annually (roughly 1–5% per month), with drawdowns of 5–15%. Anyone promising 50% monthly returns is either lying or about to blow up. We wrote a whole article on realistic EA income expectations because this comes up so often.
Getting started the right way
Learn the basics first. Understand what spreads, leverage, margin, and stop losses are before you let a program trade for you. If you don't know what the EA is doing, you can't tell when it's doing something wrong. Our forex beginner guide covers the fundamentals.
Demo account first. Always. Every broker offers one for free. Run the EA for at least 1–3 months in demo. Watch how it handles different market conditions. Don't skip this.
Start small when you go live. Demo and live are different — slippage, execution delays, and the psychological pressure of real money all change things. Start with an amount you can afford to lose entirely. We've talked to traders who went from $500 demo profits straight to $10,000 live and couldn't handle the drawdowns emotionally. Don't be that person.
Pick EAs with real track records. Not just backtests — actual live account results, running for at least 6 months, with verifiable drawdown data. If the developer won't show live results, walk away. We wrote a guide on how to spot EA scams that covers the red flags in detail.
Set hard risk limits. No matter what:
- Risk no more than 1–2% of your account per trade
- Set a maximum daily loss limit
- Cap the number of open positions
- Check in on your EA at least once a week
Installing an EA on MetaTrader
- Get the file. It'll be
.ex4(MT4) or.ex5(MT5). If you got source code (.mq4/.mq5), compile it in MetaEditor first. - Put it in the right folder. In MT4/MT5, go to File > Open Data Folder, then navigate to
MQL4/ExpertsorMQL5/Experts. Drop the file there. - Refresh and load. Right-click "Expert Advisors" in the Navigator panel and hit Refresh. Drag the EA onto your chart.
- Configure and enable. Adjust input parameters, check "Allow live trading," click OK. Then make sure the "Auto Trading" button in the toolbar is turned on.
If you see a smiley face in the top-right corner of the chart, the EA is running. If you see a frown or an X, something's wrong — check your settings. We have a step-by-step installation guide with screenshots if you need more detail.
Common myths
"EAs print money." They don't. A bad strategy is still a bad strategy whether you execute it manually or automatically. The EA just helps you lose money faster if the logic is flawed.
"Good backtests = good live results." Backtests use perfect historical data with no slippage or execution issues. Live trading has all of those. Plenty of EAs look amazing in backtests and fall apart when real money is on the line. Read our backtest vs live trading gap article for the full picture.
"Expensive = better." Some of the best EAs are free and open source. Some of the worst cost thousands. Judge by live track record, not price tag.
"Set it and forget it." You still need to monitor. Markets shift between trending and ranging. An EA that's been profitable for months can start bleeding if conditions change. Check in weekly at minimum.
"EAs replace trading knowledge." They shouldn't. You need to understand the strategy behind your EA well enough to know when poor performance is temporary bad luck versus a broken strategy that needs to be shut down. If you can't explain what your EA does in one sentence, you probably shouldn't be running it with real money.
What to do next
If you're ready to explore, browse the FXTool marketplace — every EA has live-verified performance data, full documentation, and a 7-day money-back guarantee on one-time purchases. If you want to learn more first, start with how to choose an EA or the complete backtesting guide.
And if you're still not sure whether automated trading is for you — that's fine. Run a free EA on a demo account for a month. You'll know pretty quickly whether it clicks.
About the author: The FXTool team builds and tests MetaTrader trading tools daily. We run every EA we sell on live accounts and publish the results. This guide reflects what we've learned from building 50+ EAs and working with thousands of retail traders.
Forex trading involves significant risk and may result in total loss of capital. This article is for educational purposes only and is not investment advice. Understand the risks and consider your financial situation before trading.