Installing an Expert Advisor or indicator in MetaTrader takes about two minutes once you know where things go. Until then it can be confusing: files in the wrong folder, EAs that load but never trade, or indicators that do not appear at all. This guide covers the whole process for both MT4 and MT5.
Know Your File Types
- .ex4 / .ex5: compiled programs for MT4 and MT5. These are what the platform runs.
- .mq4 / .mq5: source code. The platform compiles these automatically when you refresh, or you can compile them in MetaEditor.
- .set: a saved set of input settings (a “preset”) for an EA or indicator.
- .tpl: a chart template, which saves indicators, colours and sometimes an EA on a chart.
- .dll: an external library some tools need. Only use DLLs from sources you trust.
MT4 files (.ex4, .mq4) only work in MT4, and MT5 files only work in MT5. If your file does not appear, check you are using the right platform. See MT4 vs MT5 for why they are not interchangeable.
Step 1: Unzip the Download
Most tools come as a zip file. Right-click it and choose Extract All. Do not drag files straight out of the zip window. On Windows, if a file was downloaded from the internet, you may also need to right-click it, choose Properties and tick Unblock, especially for DLLs.
Before going further, scan the files with your antivirus. Only install tools from sources you trust, because an EA has access to your trading account.
Step 2: Open the Data Folder
MetaTrader does not use the folder it is installed in. It uses a separate data folder. To find it:
- Open MT4 or MT5.
- Click File → Open Data Folder.
- Open the MQL4 folder (MT4) or MQL5 folder (MT5).
Always use this method. If you have several MetaTrader terminals installed, each has its own data folder, and copying files into the wrong one is the most common installation mistake.
Step 3: Copy Files to the Right Place
| File | MT4 location | MT5 location |
|---|---|---|
| Expert Advisor (.ex4/.ex5, .mq4/.mq5) | MQL4\Experts | MQL5\Experts |
| Indicator | MQL4\Indicators | MQL5\Indicators |
| Script | MQL4\Scripts | MQL5\Scripts |
| Library / DLL | MQL4\Libraries | MQL5\Libraries |
| Include file (.mqh) | MQL4\Include | MQL5\Include |
| Set file (.set) | MQL4\Presets | MQL5\Presets |
| Template (.tpl) | templates (in the data folder root) | MQL5\Profiles\Templates |
Some EAs come with their own indicators. Those go in the Indicators folder even though they are used by the EA.
Step 4: Refresh the Navigator
Back in MetaTrader, open the Navigator window (Ctrl+N), right-click Expert Advisors or Indicators and choose Refresh. Your file should appear in the list. If it does not, restart the platform.
Step 5: Enable Algorithmic Trading
EAs cannot trade until you allow it in two places:
- Platform setting: go to Tools → Options → Expert Advisors and tick Allow algorithmic trading (called “Allow automated trading” in older MT4 builds). Tick Allow DLL imports only if the EA needs it and you trust the source.
- Toolbar button: click the Algo Trading button in MT5 (or AutoTrading in MT4) so it turns green.
Step 6: Attach It to a Chart
- Open a chart of the symbol and timeframe the EA is designed for.
- Drag the EA or indicator from the Navigator onto the chart, or double-click it.
- In the window that opens, check the Common tab: for EAs, make sure Allow Algo Trading (MT5) or Allow live trading (MT4) is ticked.
- On the Inputs tab, set your settings, or click Load to load a .set file.
- Click OK.
In MT5, a running EA shows a blue hat icon in the top-right of the chart; a grey hat means algo trading is off. In MT4, a smiley face means it is active and a frowning face means it is not.
Step 7: Check the Logs
Open the Toolbox (MT5) or Terminal (MT4) with Ctrl+T and look at the Experts and Journal tabs. Most EAs print a message when they start. Errors such as invalid stops, not enough money or trading disabled appear here first.
Why Is not My EA Trading?
- Algo trading is off, either in Options, on the toolbar, or in the EA’s own Common tab.
- Wrong symbol name. Brokers add suffixes such as
XAUUSDmorEURUSD.raw. Some EAs need the exact name entered in their inputs. - Wrong timeframe for the EA’s logic.
- Market closed or outside the EA’s trading hours.
- Spread filter. Many EAs will not trade when the spread is above a set maximum.
- Lot size or stops invalid for your broker: check the minimum lot and the minimum stop distance in the symbol specification.
- Not enough margin for the configured lot size.
- The EA is waiting for a signal. Some EAs only trade a few times a week. Check the Experts tab for its status messages.
Frequently Asked Questions
Can I run more than one EA at the same time?
Yes. Attach each EA to its own chart. In MT5 each chart can hold one EA, so open a second chart of the same symbol if you want two EAs on it. If several EAs trade the same symbol, make sure each uses a different magic number (an ID most EAs have in their inputs) so they do not manage each other’s trades.
Why does my indicator show nothing on the chart?
Common causes are not enough history loaded (scroll back or press Home to download more), the wrong timeframe for the indicator’s settings, or missing helper indicators the main one depends on. Check the Experts tab for errors such as “cannot load” or “array out of range”.
How do I save my settings so I do not re-enter them?
On the EA’s Inputs tab, click Save to create a .set file. To keep the whole chart, including indicators, colours and the EA, right-click the chart and choose Template → Save Template. Loading that template on any chart restores everything.
Do I need to compile .mq4 or .mq5 files?
Usually not. MetaTrader compiles source files automatically when you refresh the Navigator or restart. If a file does not appear, open it in MetaEditor (F4) and press Compile (F7). Any errors listed at the bottom explain why it will not load.
Is it safe to allow DLL imports?
Only for tools from sources you trust. A DLL can run any code on your computer, not just trading logic. If an EA does not explicitly need DLLs, leave the option off.
Before You Go Live
Installing an EA correctly is the easy part. Before running it on real money, backtest it properly, run it on a demo account for a few weeks, and make sure you understand how it handles losing trades. If it adds positions when price goes against it, read our guide on grid and martingale EAs first. If you want it to run around the clock, see whether you need a VPS.
Trading carries a high level of risk. This article is educational and is not financial advice. See our risk disclaimer.
