PipWardenStart free

How to install an Expert Advisor in MT5, step by step

How to install an Expert Advisor in MT5: the right folder, Algo Trading permissions, WebRequest URLs, and how to check in the Experts tab that the EA runs.

Key takeaways

  • An MT5 Expert Advisor is a compiled .ex5 file that belongs in MQL5\Experts inside the data folder (File → Open Data Folder), not in the installation folder.
  • Two switches in MT5 must both be on for an EA to trade, the Algo Trading button in the toolbar and Allow Algo Trading on the EA’s own Common tab, and the broker must allow EAs on the account.
  • An EA that talks to a server needs that exact address in the list under Tools → Options → Expert Advisors → Allow WebRequest for listed URL. Add nothing the EA’s documentation does not explain.
  • The blue hat on the chart only shows that MT5 lets the EA trade. The Experts tab and the EA’s own status messages show whether it actually works.
  • MT4 files (.ex4, .mq4) do not run in MT5, and no EA runs in the MT5 mobile apps or the web terminal.
On this page
  1. Before you install an Expert Advisor in MT5: what you need
  2. .ex5 vs .mq5, and why MT4 files will not work
  3. Step 1: copy the file into the data folder
  4. Step 2: set only the permissions you need
  5. Adding a WebRequest address
  6. Step 3: attach the EA to the right chart
  7. Step 4: confirm it is really running
  8. Step 5: keep it running
  9. Step 6: start on demo
  10. Quick troubleshooting
  11. Security: what never to allow
  12. How PipWarden handles installation

To install an Expert Advisor in MT5, copy its .ex5 file into the data folder (File → Open Data Folder → MQL5 → Experts), refresh the Navigator, tick Allow algorithmic trading in Tools → Options → Expert Advisors, and drag the EA onto a chart with Allow Algo Trading ticked on its Common tab. Then check that the Algo Trading button in the toolbar is green and that the Experts tab shows the EA’s start-up messages with no errors after them.

An Expert Advisor (EA) is a program that runs inside the MetaTrader 5 terminal and places and manages trades, which is what algo trading means in MT5. This guide also covers three things that often go wrong on day one: the WebRequest allow-list, checking for a real heartbeat, and running an EA in one terminal only.

Current MT5 builds say “Algo Trading”; older builds and parts of the MetaQuotes help say “Auto Trading”. They are the same switches.

Before you install an Expert Advisor in MT5: what you need

  • MT5 desktop for Windows, or a Windows VPS. The MT5 mobile apps and the web terminal cannot run Expert Advisors. If you mostly trade from a phone, read what works instead on MT5 mobile.
  • A broker account that allows EAs. If it does not, trades typically fail with return code 10026, “Autotrading disabled by server” (MQL5 trade return codes).
  • A demo account to start with. A setup mistake there costs no real money.
  • The EA file and its documentation. You need to know which symbols and timeframe it expects, which inputs to fill in, and which web addresses, if any, it must reach.
  • A terminal that can stay on. An EA works only while MT5 is open and connected. Forex trades around the clock on weekdays (see the market hours tool), so plan for a machine that can stay on 24/5.

.ex5 vs .mq5, and why MT4 files will not work

Of the file types below, only .ex5 is ready to run.

File What it is Runs in MT5?
.ex5 A compiled MQL5 program Yes. This is the file you install
.mq5 MQL5 source code Only after you compile it into an .ex5
.mqh An include file used by source code No. It is only needed for compiling
.ex4, .mq4 An MT4 program or its source No

If you only have a .mq5 file, put it in MQL5\Experts too, start MetaEditor (F4 in MT5), open the file and press F7 to compile. Errors show on the Errors tab, and no .ex5 is created until they are fixed (MetaEditor help).

MT4 programs are written in MQL4, and MetaQuotes’ own migration guide says they “should be converted to MQL5” to be used in MetaTrader 5. Renaming an .ex4 file does not convert it. If a vendor offers only an MT4 version, ask for the MT5 build.

Step 1: copy the file into the data folder

  1. In MT5, click File → Open Data Folder.
  2. Open the MQL5 folder, then Experts.
  3. Paste the .ex5 file there.
  4. Back in MT5, open the Navigator (Ctrl+N), right-click Expert Advisors and click Refresh (or restart MT5). The EA now appears in the list.

Why not the installation folder? On Windows Vista and later, an MT5 installed in Program Files keeps its editable files, the MQL5 folder included, in a separate data folder for each Windows user: C:\Users\<username>\AppData\Roaming\MetaQuotes\Terminal\<instance_id>\, according to the MT5 help. A file copied somewhere under C:\Program Files\ may never show up in the Navigator.

The second common mistake: with several MT5 installations on one PC, for example one per broker, each has its own data folder, and a file copied into one is invisible to the others. Open the data folder from the terminal you will trade in; the origin.txt file in each one names the installation it belongs to.

Step 2: set only the permissions you need

Open Tools → Options (Ctrl+O) and go to the Expert Advisors tab. The MT5 platform settings help describes each option. In short:

Option What it does
Allow algorithmic trading The master switch that lets EAs and scripts trade at all. Tick it
Disable algorithmic trading when the account has been changed Switches algo trading off when you log in to another account, for example from demo to real
Disable algorithmic trading when the profile has been changed Switches it off when you load a different set of charts
Disable algorithmic trading when the chart’s symbol or period has been changed Stops the EA on a chart from trading once you change that chart’s symbol or timeframe
Disable algorithmic trading via external Python API Concerns Python scripts, not EAs
Allow DLL imports Lets programs load Windows DLLs. MetaQuotes calls it “potentially dangerous” and recommends turning it off for unknown EAs
Allow WebRequest for listed URL Lets EAs send web requests, but only to the addresses in the list below it. Off by default

The first three “Disable…” options are protective, and they explain many cases of algo trading “switching itself off”. Our guide to the MT5 Algo Trading button covers that and error 10027.

Adding a WebRequest address

A WebRequest is how an MQL5 program talks to a web server, for example to fetch settings or report trades. The MQL5 documentation requires every server address to be on this tab’s allowed list.

  1. Tick Allow WebRequest for listed URL.
  2. Double-click the empty line below it (or click +) and type the address exactly as the EA’s documentation gives it, usually https:// plus the domain, with nothing after the domain.
  3. Click OK.

WebRequest reaches nothing outside this list. To remove an address, select it and press Delete.

If an address is missing or mistyped, the request fails, typically with error 4014, “Function is not allowed for call” in the MQL5 error list. The EA still looks normal on the chart, but it cannot reach its server. PipWarden’s EA, for example, needs exactly one entry, the site’s own address, and shows “WebRequest not allowed” on its chart panel until it is added.

Step 3: attach the EA to the right chart

  1. Open a chart of the symbol the EA’s documentation names. Brokers often add a suffix, so EURUSD may be listed as EURUSD.m, EURUSDm or EURUSD.pro. Check the exact name in Market Watch (right-click → Symbols).
  2. Set the timeframe the documentation specifies, for example H1.
  3. Drag the EA from Navigator → Expert Advisors onto the chart, or double-click it. The properties window opens.
  4. On the Common tab, tick Allow Algo Trading. Both this box and the toolbar button must be on for the EA to trade.
  5. On the Inputs tab, fill in what the documentation asks for, such as a licence key or token and the risk settings. Double-click a value to change it.
  6. Click OK.

If the EA calls functions from other files, a Dependencies tab also appears, with calls into Windows DLLs marked in red.

Attach the EA to as many charts as its documentation says, and no more. MT5 runs one EA per chart: attaching a second EA to the same chart removes the first (MT5 help). Copies on separate charts each trade on their own, and EAs tell their trades apart by a magic number, an ID stored with each order (MQL5 docs). Two copies with the same magic number may treat each other’s trades as their own.

Step 4: confirm it is really running

A loaded EA and a working EA can look the same at first glance. Check these four places (Ctrl+T opens the Toolbox with the log tabs):

Where What you want to see If not
Top-right corner of the chart The EA’s name and a blue hat icon A grey hat means MT5 is not letting it trade
Algo Trading button in the toolbar A green triangle (Ctrl+E toggles it) A red square means no EA in the terminal can trade
Journal tab A line like expert MyEA (EURUSD,H1) loaded successfully The EA did not start, or was removed
Experts tab The EA’s start-up message, then regular status lines, no repeating errors Read the error: 4014, invalid licence or token, symbol not found

The Experts tab holds messages from running EAs, the Journal tab platform events (MT5 logs help). The blue hat proves only that MT5 allows the EA to trade, not that it reached its server, accepted its licence or found the symbol. For an EA that works with a server, look for a heartbeat: a regular sign that the server answered recently.

With PipWarden, the EA shows a status panel in the top-left corner of the chart, and its Experts tab lines start with [PipWarden]. On a healthy start, with the bot started on the dashboard, the key lines of the panel read:

Connection: Connected
Bot status: active
New trades: allowed
Last heartbeat: 2026.09.28 10:15:05
Last error: none

The dashboard should show the trading account as Online within a few seconds. How it works has the same steps, with the address to allow.

Step 5: keep it running

The EA stops when MT5 stops. Three things decide whether it keeps running:

  • Sleep off. A PC that goes to sleep takes MT5 with it. On Windows 11 the timeouts are under Settings → System → Power & battery → Screen, sleep, & hibernate timeouts (Microsoft’s guide).
  • Restarts. MT5 saves open charts, and the EAs on them, in the current profile (MT5 help), so they normally come back when MT5 opens. But after a Windows update restart, nothing trades until MT5 is open again. A shortcut in the Startup folder (shell:startup, Microsoft’s steps) starts MT5 when you sign in to Windows, not before. Check the Experts tab after any restart.
  • One terminal per account. The same EA running for the same account in two terminals, say a home PC and a VPS, can send duplicate orders unless the EA prevents it. PipWarden refuses the second terminal: its chart shows “Another MetaTrader terminal is already running the EA for this account” and it opens no trades. Remove the EA from the terminal you no longer want; if that was the running copy, the waiting one takes over on its own within about half a minute.

Whether you need a VPS for this, and how to set one up, is covered in our VPS for EA guide.

Step 6: start on demo

Run the EA on a demo account first, and judge it by behaviour, not by profit or loss. In the first 30 days, watch for:

  • Uptime. Does it stay connected through a full week, including Monday’s open after the weekend?
  • Position sizes. Does each lot size match the risk you set? Check a few trades with the position size calculator.
  • Limits. When a daily loss limit or a position cap is reached, do new trades actually stop?
  • Skipped trades. A skip with a logged reason, such as “Spread too wide” or “High-impact news” (a news blackout) in PipWarden’s log, is a rule working, not a fault.
  • Errors. Anything repeating in the Experts tab needs an answer before real money is involved.

Demo execution can differ from live, in fills and slippage, so expect some difference when you switch. The Strategy Tester cannot replace this step for a server-based EA: WebRequest does not run in the tester, and PipWarden’s EA refuses to start there. Our demo testing checklist sets out the 30 days week by week.

Quick troubleshooting

What you see Likely cause Fix
EA missing from the Navigator Wrong folder, an .ex4 file, or no refresh Step 1
Grey hat on the chart Algo Trading button off, or Allow Algo Trading unticked on the Common tab Step 3, and the Algo Trading button guide
Error 4014 in the Experts tab The web address is missing from the allowed list or typed differently Step 2
10027, “Autotrading disabled by client terminal” Algo trading is switched off in your terminal The Algo Trading button guide
10026, “Autotrading disabled by server” The broker does not allow EAs on this account Ask the broker, or use another account type
Trading refused, investor password You logged in with the read-only password Log in with the master password
Loaded, no errors, no trades Often the EA’s rules working: outside its session, filters, limits, or trading paused in its settings Why an EA is not taking trades

Security: what never to allow

Never share your master password. According to the MT5 help, the master password gives full rights, while the investor password lets someone see the account but not trade. An EA running in your own terminal already works through your login and has no reason to ask for a password.

No cracked EAs. A compiled .ex5 hides the original algorithm, so you cannot inspect what a cracked or re-packed file really does, and it runs inside the terminal that holds your trading login.

No unexplained DLLs or URLs. Keep Allow DLL imports off. Do not allow DLL calls in the Dependencies tab, or add WebRequest addresses, that the vendor has not explained.

The wider warning signs of bad EAs and robot sellers are in how to spot a forex robot scam, and our forex trading bot guide explains what a bot can and cannot do.

How PipWarden handles installation

PipWarden follows the steps above, with fewer choices to get wrong:

  • One token, no password. Each trading account gets its own EA token on the dashboard, shown once. We never ask for your MT5 password, and a regenerated token cuts off the old one immediately.
  • One file, one chart, one address. You attach the .ex5 from the dashboard to a single chart, any symbol and timeframe, and it trades every pair you enable; a second copy on another chart stays idle. The ApiUrl input comes filled in, and that address is the only WebRequest entry it needs.
  • Checks before every order. Your limits are checked before every order. Right before sending one, the EA also rechecks the open-position cap and the spread with live data from your terminal. If either fails, it skips the trade and logs the reason.
  • When the link drops. Each trade’s stop loss and take profit sit at your broker from the moment it opens. After a few minutes without contact, the EA stops opening new trades until the link is back.

It needs a Windows PC or VPS running MT5 and a broker that allows EAs. It cannot run on a phone, but once set up you can watch it and use the kill switch from one. More on the features and pricing pages.

Forex/CFD trading is high risk. You can lose money. Not financial advice.

Frequently asked questions

Where do I put EA files in MT5?
In the MQL5\Experts folder of the terminal’s data folder. Open it from MT5 with File → Open Data Folder, then MQL5 → Experts. On a standard Windows install the data folder sits under C:\Users\<username>\AppData\Roaming\MetaQuotes\Terminal\, not under Program Files.
Why is my EA not showing in the Navigator?
Usually the file went into the wrong folder (the installation folder, or another terminal’s data folder), it is an MT4 .ex4 file, or the Navigator has not been refreshed. Right-click Expert Advisors in the Navigator and choose Refresh, or restart MT5. A .mq5 source file has to be compiled in MetaEditor before it can run.
Can I use an MT4 EA in MT5?
No. MT4 EAs are written in MQL4 and compiled to .ex4, while MT5 runs MQL5 programs compiled to .ex5. The code has to be converted to MQL5 and recompiled, which needs the .mq4 source, so in practice it is a job for the developer.
How do I know my EA is actually running?
Check three places. The chart’s top-right corner shows the EA’s name with a blue hat, the Journal tab shows the EA loaded successfully, and the Experts tab shows the EA’s own start-up message with no errors after it. An EA that works with a server should also report a recent heartbeat or a “connected” status.
Which WebRequest URL does my EA need?
Only the addresses the EA’s documentation lists, typed exactly as given, usually https:// plus the domain with nothing after it. Add nothing else. If an EA asks for addresses its documentation does not explain, stop and ask the vendor why.

Educational content, not financial advice. Forex and CFDs are traded on margin and are high risk: you can lose money, and more than your deposit with some brokers. Examples use made-up numbers and show no real results. Read the risk disclosure.