WONNFX BLOG · METATRADER

How to Install an EA in MT5 and MT4

Install any expert advisor or indicator in MetaTrader 5 and 4: data folder, Navigator, Algo Trading button, inputs, VPS, and how to fix the most common errors.

By Sergei Tsirat (WONNDER / WONNFX), author & developer6 MIN READUpdated

Installing an expert advisor takes two minutes once you know where the files go. Most "the EA doesn't work" messages come from three things: the file is in the wrong folder, Algo Trading is off, or the symbol name does not match. This guide covers MT5 and MT4 step by step.

Key takeaways
  • EA files go into File → Open Data Folder → MQL5 → Experts (MQL4 → Experts in MT4).
  • After copying, refresh the Navigator or restart the terminal, then drag the EA onto a chart.
  • Two switches must be on: Allow Algo Trading in the EA settings and the Algo Trading button in the toolbar.
  • Check symbol suffixes such as XAUUSD.m or GOLD — a wrong name is a common reason for no trades.
  • The Experts and Journal tabs explain almost every error.
  • A VPS keeps the EA running when your computer is off.

EA file types

FilePlatformWhat it is
.ex5MT5Compiled EA or indicator — ready to run
.mq5MT5Source code — compile in MetaEditor
.ex4MT4Compiled EA or indicator
.mq4MT4Source code
.setBothSaved input settings (presets)

An .ex5 file never runs in MT4 and an .ex4 file never runs in MT5. If you downloaded a product from the MQL5 Market, the terminal installs it automatically under Experts\Market or Indicators\Market.

Installing an EA in MT5

  1. In MetaTrader 5 click File → Open Data Folder.
  2. Open MQL5 → Experts (for indicators: MQL5 → Indicators).
  3. Copy the .ex5 file into this folder.
  4. Back in the terminal, open the Navigator (Ctrl+N), right-click Expert Advisors and choose Refresh — or restart the terminal.
  5. Open a chart of the symbol and timeframe the EA requires.
  6. Drag the EA from the Navigator onto the chart.
  7. On the Common tab tick Allow Algo Trading; if the vendor says so, also allow DLL imports.
  8. Set the inputs on the Inputs tab (or Load a .set file) and click OK.
  9. Make sure the Algo Trading button on the top toolbar is green.
How to check it is running

In MT5 a small blue hat icon in the top-right corner of the chart means the EA is attached and allowed to trade. If the icon is grey, Algo Trading is disabled for the terminal or for that EA.

Installing an EA in MT4

  1. File → Open Data Folder → MQL4 → Experts.
  2. Copy the .ex4 file there and refresh the Navigator or restart.
  3. Drag the EA onto a chart.
  4. On the Common tab tick Allow live trading.
  5. Turn on the AutoTrading button in the toolbar. A smiling face in the chart corner means the EA is active.

Inputs and presets

Every EA has inputs: lot or risk %, stop-loss, take-profit, trading hours, filters. Start with the vendor's defaults on a demo account. When you find settings you like, use Save on the Inputs tab to create a .set file — it makes reinstalling or moving to a VPS easy and lets you compare versions.

⚙Check the lot size your EA will useFree Position Size and Margin calculators→

Common errors and how to fix them

Message or symptomCauseFix
EA not in NavigatorWrong folder or wrong platform filePut .ex5 in MQL5/Experts, refresh
“AlgoTrading disabled”Toolbar button offTurn Algo Trading / AutoTrading on
Grey hat / sad face on chartLive trading not allowed in EA settingsTick Allow Algo Trading on Common tab
“Trade is disabled”Investor (read-only) login or market closedLog in with the trading password
“Invalid stops”SL/TP too close for the brokerIncrease SL/TP or check stop level
“Not enough money”Lot too big for marginLower lot or risk %
No trades on XAUUSDSymbol has a suffix (XAUUSD.m, GOLD)Set the symbol name in inputs
Works in tester, not liveDifferent server time or filtersCheck time offset and trading hours

When in doubt, open the Toolbox → Experts and Journal tabs: every EA error and rejected order is logged there with a reason.

Understanding the EA settings window

When you attach an EA, MetaTrader opens a window with several tabs. Knowing what each one does prevents most beginner mistakes.

TabWhat you setTip
CommonAllow Algo Trading, DLL imports, signal settingsUntick DLL unless the vendor requires it
InputsStrategy parameters: lot, risk, SL/TP, hoursSave your settings as a .set file
Dependencies (MT5)Libraries and indicators the EA usesMissing files show here

Magic numbers and running several EAs

Every EA marks its trades with a magic number. If you run two EAs — or the same EA on two charts of one symbol — give each a different magic number in the inputs. Otherwise one EA may manage, modify or close the other's positions. Manual trades have a magic number of 0, which is how most EAs know to leave them alone.

Updating an EA safely

  1. Save the current inputs to a .set file.
  2. Wait until the EA has no open positions, or note them down.
  3. Replace the .ex5 file in the Experts folder and refresh the Navigator.
  4. Reattach the EA to the chart, load your .set file and check the Experts tab for messages.

On MQL5 Market products, updates arrive through the terminal's Market tab and install automatically.

Installing indicators and scripts

Indicators and scripts follow exactly the same steps, only the folder changes: MQL5\Indicators or MQL5\Scripts (and MQL4\... in MT4). Indicators are dragged onto a chart and never trade; scripts run once and stop.

Running EAs 24/5 on a VPS

An EA only trades while the terminal is running and connected. If your computer sleeps or the internet drops, trades are not opened or managed. A Virtual Private Server keeps the terminal online around the clock; MT5 also offers a built-in virtual hosting service that migrates your charts and EAs with one click. Choose a server location close to your broker's trade server to minimise latency.

A safe first setup

  1. Install the EA on a demo account first.
  2. Add a news filter and an account-level daily loss monitor.
  3. Run it for several weeks and compare results with the vendor's description.
  4. Go live with the minimum risk and scale up gradually.
◉Daily loss and drawdown on the chartWONNFX MONITOR EA — free for MT5 / MT4→

Frequently asked questions

File → Open Data Folder → MQL5 → Experts. Indicators go to MQL5 → Indicators. Then refresh the Navigator.
Most often the Algo Trading button is off, Allow Algo Trading is not ticked in the EA settings, the account is logged in with an investor password, or the symbol name does not match.
Yes. Attach each EA to its own chart. Make sure they use different magic numbers if they trade the same symbol.
Not required, but recommended: an EA only works while the terminal is online. A VPS keeps it running 24/5.
Buy or download it inside the terminal (Toolbox → Market). It installs automatically into Experts\Market and appears in the Navigator.
A number an EA attaches to its trades so it can identify and manage only its own positions. Use different magic numbers for different EAs on the same symbol.
Live or algo trading is not allowed — either the Algo Trading/AutoTrading button is off or the option is unticked on the EA's Common tab.

Sergei Tsirat (WONNDER / WONNFX) — author and developer of the WONNFX project. MQL5 profile · Telegram

Educational content only, not financial advice. Leveraged trading carries a high risk of loss. Past performance does not guarantee future results. Broker and prop-firm rules change — always check the current conditions of your provider.

Keep reading

Related guides

Get new guides and signals in Telegram

Project news, tool updates, economic news and trade notices from WONNFX.

WONNFX ONLINE
Trading forex and CFDs involves significant risk and may not be suitable for every investor. Articles are educational and are not investment advice. WONNFX is not a broker. · wonnfx.online · Blog · Calculators · Telegram
project news and updates:
[WONNFX ON TELEGRAM]
Project news. Information about new products and updates.
Project community.
Chat for communication.
Publication of important economic news in the telegram channel.
Publication of opening and closing deals in the telegram channel.