Home > Blog > Complete Guide to Installing and Configuring an EA in MT5

MT5EA Setup

Complete Guide to Installing and Configuring an EA in MT5

Published: 2026-10-02Read time: about 4 min
⏱ This article reflects information as of its publish date. EA performance figures (PF, DD, annual return) change with live trading and re-validation — check the latest on the EA pages. See the latest EA results →
Contents (12)
  1. Quick Steps (7 Steps)
  2. What You Need Before Installing an EA
  3. Step 1: Place the EA File in the Correct Folder
  4. Step 2: Compile the EA (.mq5 File)
  5. Step 3: Attach the EA to a Chart
  6. Step 4: Configure the EA Settings
  7. Step 5: Confirm MT5's Automated Trading Switch is On
  8. How to Run a Backtest
  9. Common Issues and How to Fix Them
  10. Important Notes While the EA Is Running
  11. Summary
  12. Related Pages

Complete Guide to Installing and Configuring an EA in MT5 [Beginner's Guide]

This guide walks you through every step of adding an Expert Advisor (EA) to MetaTrader 5 (MT5) so you can start automated trading. Even if this is your first time, the steps below explain the basic installation process.

Still deciding which EA to install? Try the 3-question EA Finder to narrow candidates by capital, market and risk classification. Before using any EA, review the backtest methodology and forward-test evidence; this guide does not guarantee profitability.

Quick Steps (7 Steps)

Start by working through the steps below in order. Each step is explained in detail in the sections that follow.

  1. In MT5, go to "File" → "Open Data Folder" and place the EA file (.ex5 or .mq5) in MQL5/Experts/
  2. Only for a .mq5 file: open it in MetaEditor (F4), compile it (F7) and confirm "0 error(s)" (not needed for an .ex5 file)
  3. Open a chart for the currency pair and timeframe you want to trade, then drag and drop the EA from "Expert Advisors" in the "Navigator" onto the chart
  4. In the "Common" tab of the settings dialog, check "Allow automated trading"
  5. In the "Inputs" tab, review lot sizing, stop-loss behavior, symbol and broker requirements rather than assuming the defaults suit your account
  6. Turn on the "Automated Trading" button in the toolbar (green)
  7. Check that the EA name and enabled automated-trading icon appear in the upper-right corner of the chart; also inspect the Experts and Journal logs. Verify the strategy in the Strategy Tester and, when that product license allows it, on a demo account.

Recommended Broker Comparison →

🎁 Download Free EA

📧 Free 8-email course + subscriber-only pack of 13 MT5 indicators

* Privacy strictly protected. You can unsubscribe at any time.

What You Need Before Installing an EA

  • A PC with MetaTrader 5 (MT5) already installed
  • A .mq5 or .ex5 file (the EA program file)
  • An MT5-compatible trading account (XM Trading, Exness, HFM, etc.)

.mq5 is the source code format; .ex5 is the compiled executable. EAs distributed on fxea365.com come as a zip containing the compiled .ex5, in which case the compilation in Step 2 is not needed. If you received a .mq5 file, you will need to compile it inside MT5.


Step 1: Place the EA File in the Correct Folder

Open MT5 and click "File" → "Open Data Folder" in the menu bar.

Inside the folder that opens, copy your .mq5 file to the following path:

MQL5 > Experts > [place your file here]

You can create a subfolder to keep things organized (e.g., MQL5/Experts/fxea365/).

Important: Do not place the file in the "Indicators" or "Scripts" folders. EAs must always go in the "Experts" folder.


Step 2: Compile the EA (.mq5 File)

  1. From the MT5 menu, go to "Tools" → "MetaEditor" (or press F4)
  2. In the MetaEditor, find your .mq5 file in the left-side Navigator and double-click it to open
  3. Click the "Compile" button in the menu (or press F7)
  4. If the Errors tab at the bottom shows "0 error(s), 0 warning(s)", the compilation was successful

Once compilation is complete, an .ex5 file will be generated in the same folder. This is the actual executable EA.

If you received only an .ex5 file, skip this step.


Step 3: Attach the EA to a Chart

  1. Return to MT5 and open a chart for the currency pair and timeframe you want to trade
  2. In the left-side "Navigator" panel, expand "Expert Advisors"
  3. Drag and drop your EA onto the chart (or double-click it)
  4. A settings dialog will appear

The EA listed under Expert Advisors in the Navigator
The EA listed under Expert Advisors in the Navigator


Step 4: Configure the EA Settings

The settings dialog has three main tabs.

The EA's Inputs tab (set lot size, risk %, MagicNumber and other parameters here)
The EA's Inputs tab (set lot size, risk %, MagicNumber and other parameters here)

"Common" Tab

SettingRecommended
Allow automated tradingCheck this box
Allow DLL importsDepends on the EA (usually not required)
Allow import of external expertsDepends on the EA

If "Allow automated trading" is not checked, the EA will not place any trades. This is the most common setup mistake.

"Inputs" Tab

The input parameters differ between EAs. Before you click OK, identify the settings for position size, maximum risk, stop loss, spread restrictions and trade identifiers (MagicNumber). Do not assume every EA uses RiskPercent or the same units for MaxSpread; some use points, others use pips or a price distance.

CheckPractical question
Position sizingDoes the EA calculate lots from account risk, or does it use a fixed lot?
Stop-loss designIs there a hard SL, and what happens if the broker rejects it?
Spread filterAre its units documented, and does it block trades during volatile conditions?
Broker specificationsIs the minimum lot, step size and margin compatible with this EA?
MagicNumberWill another EA on the account conflict with this identifier?

Do not blindly copy example risk percentages or widen the allowed spread to force trades. Consult the product's configuration guide and confirm behavior in the tester first.

"Dependencies" Tab

No changes are needed here under normal circumstances.


Step 5: Confirm MT5's Automated Trading Switch is On

Attaching the EA to a chart is not enough on its own. Make sure the "Automated Trading" button (green play button) in the MT5 toolbar is turned on.

  • Button is green → Automated trading is ON (EA is active)
  • Button is grey → Automated trading is OFF (EA will not trade)

Look for the EA name and the enabled/disabled automated-trading status icon in the upper-right corner. In MT5 this is not the MT4 smiley-face indicator. An attached EA may still have trading disabled or no valid signal, so also check the Experts and Journal logs.


How to Run a Backtest

It is strongly recommended to run a backtest to verify the EA's behavior before going live.

MT5 Strategy Tester Settings tab (EA, symbol, timeframe, period and modelling mode)
MT5 Strategy Tester Settings tab (EA, symbol, timeframe, period and modelling mode)

  1. In MT5, go to "View" → "Strategy Tester" (or press Ctrl+R)
  2. In the "Expert Advisor" field, select your EA
  3. Set the currency pair, timeframe, and date range
  4. Under Model, select "Every tick (slowest method based on all available least timeframes)"
  5. Click "Start"

For detailed backtest configuration instructions, see the MT5 Backtest Complete Guide.


Common Issues and How to Fix Them

The EA Is Not Placing Trades

CauseFix
Cause 1The "Automated Trading" button is turned offCheck the toolbar and turn it on
Cause 2"Allow automated trading" was not checked when attaching the EA to the chartDouble-click the EA on the chart → go to the "Common" tab → verify the checkbox
Cause 3The spread exceeds the EA\u2019s permitted thresholdInspect broker spread and the EA\u2019s filter units; do not widen limits just to trigger trades
Cause 4A time filter is active and the current time is outside the allowed windowCheck the UseTimeFilter parameter

Compilation Error

Cause: MT5 is outdated or a required library is missing → Update MT5 to the latest version

If these do not solve the problem, see the article that matches your symptom:


Important Notes While the EA Is Running

  • Using a VPS is recommended: When your PC shuts down, the EA stops too. A VPS is required to keep the EA running 24 hours a day. Compare recommended VPS options
  • Watch for swap charges: Depending on the currency pair, overnight swap points may apply
  • Check the EA regularly: Make it a habit to review the MT5 Experts log daily
  • Verify license and test first: Prefer backtesting and demo verification when that specific product allows it. A free MQL5 Market EA and a partner-live-account-licensed EA may have different requirements. If demo is unavailable, this is a limitation to consider, not a reason to risk real funds without preparation.

Summary

Installing an EA in MT5 comes down to seven steps:

  1. Place the .mq5 or .ex5 file in the MQL5/Experts/ folder
  2. Compile only .mq5 source code in MetaEditor; an .ex5 file is already compiled
  3. Drag and drop it onto the chart to attach it
  4. In the "Common" tab of the settings dialog, check "Allow automated trading"
  5. Verify risk, volume, symbol and spread parameters for your account
  6. Turn on MT5's "Automated Trading" button
  7. Confirm the EA name and MT5 automated-trading status icon, check the Experts log, then verify behavior by backtest and on demo if the license permits it

This site also offers EAs that you can download for free. You can find them in the EA List & Rankings.

📧 Free 8-email course + subscriber-only pack of 13 MT5 indicators

* Privacy strictly protected. You can unsubscribe at any time.

Have a question about EAs or FX?

You can post it on the Nattzy trading forum (free sign-up). Questions beyond this article are welcome too — EA settings, choosing a broker and more.

Ask on Nattzy ↗

Comments & questions