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

MT5EA SetupBeginnerInstallation

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

Published: 2026-05-22Read time: about 3 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

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, following these steps will get you up and running without issues.


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 in .mq5 format, which means you will need to compile them inside MT5 before use.


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

Step 4: Configure the EA Settings

The settings dialog has three main tabs.

"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

This tab lets you fine-tune how the EA behaves. Key parameters include:

ParameterMeaningRecommended for Beginners
UseFixedLotUse a fixed lot sizefalse (auto-calculate by risk %)
RiskPercentRisk per trade as a percentage0.5 to 1.0
FixedLotFixed lot size0.01
MaxSpreadMaximum allowed spread (pips)3.0
MagicNumberEA identifier numberLeave as default

Beginners are generally advised to leave all settings at their default values.

"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)

If the EA name and a smiley face icon appear in the upper-right corner of the chart, the EA is running correctly.


How to Run a Backtest

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

  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

Cause 1: The "Automated Trading" button is turned off → Check the toolbar and turn it on

Cause 2: "Allow automated trading" was not checked when attaching the EA to the chart → Double-click the EA on the chart → go to the "Common" tab → verify the checkbox

Cause 3: The spread exceeds the MaxSpread setting → Increase the MaxSpread parameter (e.g., to 5.0)

Cause 4: A time filter is active and the current time is outside the allowed window → Check the UseTimeFilter parameter

Compilation Error

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


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
  • Test on a demo account first: Run the EA on a demo account for at least two weeks before going live

Summary

Installing an EA in MT5 comes down to five steps:

  1. Place the .mq5 file in the MQL5/Experts/ folder
  2. Compile it in MetaEditor (generates the .ex5 file)
  3. Drag and drop it onto the chart to attach it
  4. Configure the parameters (beginners should use defaults)
  5. Turn on MT5's "Automated Trading" button

All EAs on this site are distributed free of charge. You can start using them immediately after opening a broker account.

5-Day Email Course (Free)

Get one email a day covering the essentials of FX automated trading, how to read backtests correctly, and tips for choosing a broker.

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

Comments & questions