How to Install an Expert Advisor in MT5 and Fix It When It Will Not Trade
Copy the EA into the MQL5\Experts folder (File, Open data folder), compile it with F7 if you have the .mq5 source, drag it from the Navigator onto a chart, and make sure Allow Auto Trading and the toolbar button are on. Only one Expert Advisor can run per chart.
The steps, in order
These steps come from MetaQuotes' MetaTrader 5 help pages, read on 23 November 2026. We did not install an EA on a live dealer account for this page. Menu names can differ slightly between builds and dealers.
One. In MT5, open the File menu and click Open data folder. Two. Inside it, open MQL5, then Experts, and place your EA file there. A compiled file has the extension .ex5; a source file has .mq5. Three. If you have only the .mq5 source, open it in MetaEditor (press F4 in the platform) and press F7 to compile. If there are no errors, an .ex5 file is created in the same folder. Four. Back in the platform, find the EA under Expert Advisors in the Navigator; restart the platform if it is not listed. Five. Double-click it or drag it onto a chart. In the properties window, review the inputs and click OK. Six. Check the chart's upper-right corner: a successful start shows the EA's name and an Auto Trading icon.
Only one Expert Advisor can run on one chart, though a chart can hold any number of indicators.
| Step | Action | Result |
|---|---|---|
| 1 | File, Open data folder | Opens the platform's data directory |
| 2 | Copy file into MQL5\Experts | EA is available in the platform |
| 3 | Open .mq5 in MetaEditor, press F7 | Creates an .ex5 file if there are no errors |
| 4 | Find EA in Navigator, drag onto chart | Properties window opens |
| 5 | Review inputs, click OK | EA name and Auto Trading icon show on the chart |
The three switches that make an EA trade
Most EAs that load but do not trade are blocked by a permission. MetaQuotes' help describes three layers. The AutoTrading button on the toolbar enables or disables automated trading for the whole platform. The EA's own properties have a permission to allow it. And the platform's Options dialog (Tools, Options, or Ctrl+O), on the Expert Advisors tab, has Allow Auto Trading.
That tab also has options that disable automated trading when you switch accounts, profiles, or chart symbols or periods. Those can turn trading off without warning, which is easy to miss if you change the chart timeframe. It also has Allow DLL imports, which MetaQuotes labels potentially dangerous, to be enabled only for trusted applications, and Allow WebRequest for listed URL, which is off by default and needs each URL added by hand. If an EA that uses a DLL shows no OK button when you attach it, DLL imports are disabled.
Worked example: why an EA does nothing
This is an illustrative case. You drop an EA on an EURUSD chart. The name appears but no Auto Trading icon, and no orders are sent.
Check in this order. First, is the toolbar AutoTrading button on? If not, click it. Second, in the EA's properties, is the permission to trade allowed? Third, open Tools, Options, Expert Advisors and confirm Allow Auto Trading. Fourth, read the messages in the Experts tab at the bottom of the platform.
If the EA then tries to trade and fails, the server returns a code. MetaQuotes documents these among its trade return codes.
| Code | MetaQuotes description | First thing to check |
|---|---|---|
| 10027 | Autotrading disabled by client terminal | Toolbar button and Allow Auto Trading |
| 10026 | Autotrading disabled by server | Ask the dealer; the server blocks it |
| 10017 | Trade is disabled | Account or symbol trading permission |
| 10018 | Market is closed | Trading hours of the symbol |
| 10019 | There is not enough money to complete the request | Free margin versus lot size |
| 10014 | Invalid volume in the request | Lot size and step of the symbol |
| 10030 | Invalid order filling type | Filling mode the symbol accepts |
| 10031 | No connection with the trade server | Internet and server name |
| 10032 | Operation is allowed only for live accounts | Account is a demo |
Compile errors and warnings
MetaEditor's help says errors block output: no executable file is created if they occur. Warnings still produce an executable but should be fixed. The Errors tab in MetaEditor's Toolbox shows the compilation log, and double-clicking an error jumps to the line. If you change the code, recompile with F7 or the previous version keeps running. Only a main source file or a project produces an executable, so compiling an include (.mqh) file on its own does not give you an EA.
Canadian dealers and EAs
Of the CIRO-registered dealers we could read, CMC Markets Canada lists MT5 and OANDA Canada lists MT4 only. CMC's MT5 page lists Expert advisors and MQL5 automation as a feature, with servers named CMCMarkets-MT5-LIVE and CMCMarkets-MT5-DEMO. It does not describe EA installation, restrictions or VPS use; for those it points you to its client management team at 1-866-884-2608. The desktop download on its MT5 page is a Windows installer. Our MetaTrader in Canada page covers which dealers offer MT4 and MT5.
For MT4 we could not read MetaQuotes' help (the connection reset), so we cannot confirm folder names there. MetaEditor's help says compiled files are .ex4 or .ex5, and the data folder command in the File menu is the place to start. The MQL4 folder name is not confirmed.
Safety and who should not do this
An EA is code that can place real orders. Do not run one you cannot read on a funded account. Test it first on a demo account. Never enable DLL imports for a file you do not trust. If a prop firm account is involved, check the firm's rules on automated trading first; our automated trading page covers prop firm rules. An EA's past results are no guide to its future results, and nothing here is advice.
Frequently asked questions
Where do I put an EA file in MT5?
In the MQL5\Experts folder, opened from File, Open data folder.
Why is my EA attached but not trading?
Check the toolbar AutoTrading button, the EA's own permission and Allow Auto Trading under Tools, Options, Expert Advisors. Then read the Experts tab.
How many EAs can run on one chart?
One. MetaQuotes says only one Expert Advisor can run on one chart.
What does error 10027 mean?
Autotrading disabled by client terminal. Turn on the toolbar AutoTrading button and Allow Auto Trading.
Can I install an EA in MT4 the same way?
The steps are likely similar, but we could not confirm MT4's folder names from MetaQuotes' pages.
Sources
Provider documents behind this page, checked November 23, 2026.
- MetaQuotes · MetaTrader 5 help, Expert Advisors and indicators
- MetaQuotes · MetaTrader 5 help, Auto trading
- MetaQuotes · MetaTrader 5 help, Data folder structure
- MetaQuotes · MetaTrader 5 help, Settings
- MetaQuotes · MetaEditor help, Compilation
- MQL5 · Trade server return codes
- CMC Markets Canada · MetaTrader 5
- OANDA Canada · Trading platforms