What Is an Expert Advisor (EA) in MetaTrader? Full Setup Guide
An Expert Advisor (EA) is an automated script that trades a MetaTrader account on a trader's behalf. Here's what it actually does, how it differs from copy trading, and how to install one on MT4 or MT5.
If you're asking what is an expert advisor in MT4 and MT5, the short answer is this: it's a piece of software that runs inside your MetaTrader terminal and trades on your behalf according to a fixed set of coded rules. It reads live price data on a chart, checks that data against its programmed conditions, and opens or closes positions automatically the moment those conditions are met — no clicking, no second-guessing.
If you've seen the term "EA trading MT4" or "automated trading MT4" mentioned in a Telegram group or forum and wondered whether it's the same as following a signal provider, it isn't. An EA is code that decides and executes trades itself, sitting inside your own terminal. This guide covers what an EA actually does, how it's genuinely different from copy trading or manually executing someone else's calls, and a full walkthrough of installing one on both MT4 and MT5, including the permission settings that trip up almost everyone the first time.
Trading with an EA, like any form of trading, carries risk — automation removes the manual clicking but not the possibility of losses, so whatever rules an EA runs on should be understood before it's left to trade unattended.
What Is an Expert Advisor (EA) in MT4 and MT5?
In plain terms, an EA is an automated program written in MQL4 (for MT4) or MQL5 (for MT5) that attaches to a chart and executes trades without manual intervention. It doesn't suggest trades for you to approve — it places them directly through your MetaTrader terminal, using whatever logic its developer coded into it.
Picture a simple example: an EA attached to a EURUSD chart is programmed to watch two moving averages, say a 20-period and a 50-period. The rule is basic — when the 20-period average crosses above the 50-period average, open a buy order. The EA checks this condition on every new price tick. The instant the crossover happens, it sends a buy order to your broker automatically, sets whatever stop loss and take profit were defined in its settings, and logs the action. You don't see it coming, decide to click, or confirm anything. The code has already acted.
That's the core distinction between an EA and everything else people call "automated trading" — the decision-making and the execution both happen inside the terminal, driven by code, with the trader's only real job being to configure it and choose when to let it run.
How an EA Differs from Copy Trading and Manual Trading
This is where most new traders get confused, because EAs, copy trading services, and manually following a signal all end with a trade appearing on your account — but how that trade gets there is completely different in each case.
An EA runs inside your MT4 or MT5 terminal. It's attached to a specific chart, it has its own code, and it decides for itself when to open and close trades based on that code. A copy trading service, by contrast, runs outside the terminal entirely — it watches another trader's account or a signal feed and mirrors those trades onto yours, without any chart-based logic of its own running locally. Manual execution is simpler still: a trader reads a signal, perhaps posted in a Telegram channel, and opens MetaTrader to click buy or sell themselves, applying their own judgement about lot size, entry timing, or whether to take it at all.
| Method | Where it runs | Who/what decides the trade |
|---|---|---|
| Expert Advisor | Inside MT4/MT5, attached to a chart | The EA's own code, based on chart conditions |
| Copy trading service | Outside the terminal, via a separate platform | Another trader's or channel's executed trades, mirrored onto yours |
| Manual execution | You, reading a signal and opening MT4/MT5 | You, interpreting the signal and clicking the trade |
The practical difference that matters most to a trader choosing between these is control versus effort. An EA needs no ongoing input once it's running, but you're trusting its code completely. Manual execution puts every decision in your hands but requires you to be present and alert to act on a signal in time. Copy trading sits in between — someone else is doing the deciding, but the mirroring is automated so you don't have to watch and click yourself.
Where EAs Come From
Before installing anything, it's worth knowing what you're actually downloading, because the three common sources carry quite different levels of transparency.
Custom-coded by a developer. Some EAs are written specifically for one trader or a small group, using MQL4 or MQL5, the programming languages built into MetaTrader for this purpose. These can be tailored to a very specific strategy, but unless you commissioned the code yourself or can read it, you're trusting the developer's description of what it does.
Bought or rented from the MQL5 Market. This is MetaQuotes' own marketplace, built into the MT5 terminal (and accessible via MT4 too), where developers list EAs for sale or rent. Listings typically include a description, some version history, and user reviews, which gives a bit more visibility than an anonymous download — though reviews and past behaviour describe what the EA has done before, not what it will do going forward.
Downloaded free from forums or vendor sites. Plenty of EAs circulate outside any marketplace, shared on trading forums or offered free from a vendor's website. These are the hardest to verify. There's no review process, no enforced description standard, and in the worst cases a file could contain code doing something other than what's advertised. If you go this route, it's worth checking the source's reputation, reading any available code or documentation, and testing on a demo account before ever letting it trade on real money.
How to Install an Expert Advisor on MT4
MT4 uses .ex4 files for EAs, and the installation process is entirely file-and-folder based — there's no in-terminal marketplace built in the way MT5 has it.
Finding the MT4 Data Folder and Experts Folder
Every MT4 installation has a "data folder" where all the terminal's working files live, including the Experts subfolder where EA files need to sit. To find it:
- Open MT4 and go to File > Open Data Folder. This opens a Windows Explorer window pointed at your specific terminal instance.
- Inside, navigate to MQL4 > Experts.
- Copy your downloaded .ex4 file into that Experts folder.
Once the file is in place, MT4 won't necessarily see it straight away. You need to either restart the terminal completely, or right-click on "Expert Advisors" in the Navigator panel on the left-hand side and choose Refresh. If the EA still doesn't show up after that, double-check it actually landed in MQL4/Experts and not a parent folder — this is the single most common point where new users get stuck.
Attaching the EA to a Chart and Enabling AutoTrading
Having the file in the right folder only gets the EA listed in the Navigator — it isn't trading until it's attached to a chart and AutoTrading is switched on.
- Open the Navigator panel (Ctrl+N if it's not visible), expand Expert Advisors, and find your EA in the list.
- Drag it from the Navigator directly onto the chart you want it to trade on.
- A settings window will open. Go to the Common tab and make sure Allow live trading is ticked — this checkbox is easy to miss and is one of the quietest ways an EA fails to do anything at all.
- Click OK to attach it.
- Make sure the AutoTrading button in the main toolbar is switched on (it should show green).
- Check the top-right corner of the chart: a smiley-face icon confirms the EA is attached and AutoTrading is active. A frown face means something is still switched off.
How to Install an Expert Advisor on MT5
MT5 works similarly in principle but uses .ex5 files, has its own folder structure, and adds a marketplace route that doesn't exist in quite the same way on MT4.
Installing from the MQL5 Market vs Copying Files Manually
Which installation method you use depends entirely on where you got the EA.
If you bought or rented it from the MQL5 Market:
- Open the Market tab inside MT5 (or log into the MQL5 website with the same account).
- Search for the EA by name.
- Click Install. MT5 downloads and places the file correctly on its own — no manual copying required.
If you downloaded an .ex5 file manually from a vendor site or forum:
- Go to File > Open Data Folder.
- Navigate to MQL5 > Experts.
- Copy the .ex5 file into that folder.
- Restart MT5, or right-click Expert Advisors in the Navigator and select Refresh.
Both routes end with the EA appearing in the Navigator's Expert Advisors list, ready to be dragged onto a chart exactly as in MT4.
Enabling Algo Trading and Granting DLL/WebRequest Permissions
MT5 calls its master switch "Algo Trading" rather than "AutoTrading," and some EAs need extra permissions beyond that switch to function correctly — particularly ones that pull data from external sources or use compiled code libraries.
- Go to Tools > Options > Expert Advisors tab.
- If the EA uses DLLs (external code libraries), tick Allow DLL imports. Only do this for EAs from a source you trust, since DLLs run outside MQL5's normal sandboxing.
- If the EA needs to contact an external web address, for example to fetch news data or send notifications, tick Allow WebRequest for listed URL and add the specific URL the EA's documentation specifies.
- Close the Options window, then click the Algo Trading button in the main toolbar so it shows active (usually green).
- As with MT4, drag the EA onto the chart, confirm Allow live trading (or MT5's equivalent wording) is ticked in the Common tab, and check for the smiley-face icon.
Common EA Setup Mistakes and How to Check It's Actually Running
An EA can look attached and still not place a single trade, usually because of one of a handful of recurring issues. Before assuming the EA itself is broken, run through this:
- Check the face icon. A frown face in the chart's corner means AutoTrading (or Algo Trading on MT5) is off at either the terminal level or the individual chart level. Fix the toolbar toggle and recheck.
- Read the Experts tab log. At the bottom of the terminal, the Experts tab (and the Journal tab) record error messages whenever the EA tries and fails to do something — wrong lot size, insufficient margin, a disabled permission. These messages are usually specific enough to point straight at the problem.
- Confirm your broker allows automated trading on that account. Not every account type from every broker permits EA trading by default, and some impose restrictions worth checking with the broker directly if an EA seems to be blocked for no visible reason.
- Check how many EAs are on the chart. Most EAs are built to run one-per-chart. Attaching a second EA to the same chart, or the same EA twice, can cause conflicting orders or silent failures unless the EA's own documentation explicitly supports multiple instances.
If all of that checks out and the EA still isn't trading, the most likely explanation is that its actual market conditions simply haven't been met yet — not every EA fires constantly, and some can sit quietly through long stretches where its coded conditions never line up.
It's also worth being clear about what EAs are and aren't in relation to other forms of automation you might come across. An EA has to be installed into the terminal, attached to a chart, and run with AutoTrading enabled, which generally means keeping a computer or VPS running continuously. Traders who want automated execution of signals without that setup sometimes look at services like MarketSync instead, which copies trading signals from Telegram channels directly onto an MT4 or MT5 account from its own cloud-based web app — no EA, no chart attachment, and no need to leave a computer switched on.
Frequently asked questions
Is using an Expert Advisor legal or allowed by brokers?
EAs are a standard, built-in feature of MT4 and MT5, so running one is not illegal. That said, individual brokers can set their own rules about automated trading on certain account types, so it's worth confirming directly with your broker rather than assuming every account permits it.
Do I need a VPS to keep an EA running 24/7?
An EA only trades while the MT4 or MT5 terminal it's attached to is open and connected, so if you want it running continuously you need something keeping that terminal online around the clock — commonly a VPS (virtual private server), since leaving a home computer on indefinitely is impractical for most people.
Can I run more than one EA on the same MT4 or MT5 account?
Yes, generally by attaching different EAs to different charts within the same terminal, though each should be checked for how it manages position sizing and margin so multiple EAs don't end up taking conflicting or oversized positions on the same account.
Will an EA keep trading if I close MetaTrader or turn off my computer?
No. An EA only operates while its terminal is open and connected to the internet; close MetaTrader or shut down the machine it's running on and the EA stops executing trades immediately, which is exactly why continuous operation usually requires a VPS.
What's the difference between an EA and a 'forex robot'?
In practice, these terms are used interchangeably — "forex robot" is just informal language for an Expert Advisor, describing the same thing: a coded program attached to a MetaTrader chart that trades automatically.
Can I modify an EA's settings without knowing how to code?
Most EAs expose their adjustable settings as input parameters in the attachment window, visible when you drag the EA onto a chart, letting you change things like lot size or stop loss distance without touching any code. Changing the underlying logic itself, however, requires editing the source in MetaEditor and recompiling, which does require coding knowledge.
Getting started from here
If you've never run an EA before, the safest next step is attaching one to a demo account first, watching how it behaves in the Experts log, and getting comfortable with the AutoTrading or Algo Trading toggle before any real money is involved. From there, the installation steps above apply the same way regardless of which EA you're using — the folder locations and permission settings are standard across MT4 and MT5.
If what you're actually after is automated execution of Telegram signals rather than running EA code yourself, that's a different problem with a different tool, and MarketSync is built specifically for that — connecting an MT4 or MT5 account through its own web app, with no software to install and no computer that needs to stay switched on.
Frequently asked questions
Is using an Expert Advisor legal or allowed by brokers?
EAs are a standard, built-in feature of MT4 and MT5, so running one is not illegal. That said, individual brokers can set their own rules about automated trading on certain account types, so it's worth confirming directly with your broker rather than assuming every account permits it.
Do I need a VPS to keep an EA running 24/7?
An EA only trades while the MT4 or MT5 terminal it's attached to is open and connected, so if you want it running continuously you need something keeping that terminal online around the clock — commonly a VPS (virtual private server), since leaving a home computer on indefinitely is impractical for most people.
Can I run more than one EA on the same MT4 or MT5 account?
Yes, generally by attaching different EAs to different charts within the same terminal, though each should be checked for how it manages position sizing and margin so [multiple EAs don't end up taking conflicting or oversized positions](/blog/currency-correlation-forex-risk) on the same account.
Will an EA keep trading if I close MetaTrader or turn off my computer?
No. An EA only operates while its terminal is open and connected to the internet; close MetaTrader or shut down the machine it's running on and the EA stops executing trades immediately, which is exactly why continuous operation usually requires a VPS.
What's the difference between an EA and a 'forex robot'?
In practice, these terms are used interchangeably — "forex robot" is just informal language for an Expert Advisor, describing the same thing: a coded program attached to a MetaTrader chart that trades automatically.
Can I modify an EA's settings without knowing how to code?
Most EAs expose their adjustable settings as input parameters in the attachment window, visible when you drag the EA onto a chart, letting you change things like lot size or stop loss distance without touching any code. Changing the underlying logic itself, however, requires editing the source in MetaEditor and recompiling, which does require coding knowledge.