How to install Expert Advisors (EAs) in MetaTrader 5
Reading time: 6 minutes
MetaTrader 5 makes installing an Expert Advisor straightforward, but key differences arise depending on the EA's origin: MQL5 Market, a third-party developer, or your own MQL5 code. Installing an EA does not guarantee that it will trade correctly.
This guide walks you through the installation process, from obtaining the EA files to testing it before live use, while covering the technical details and common issues that can prevent an EA from working correctly.
Key Points
- EA installation depends on the source: MQL5 Market EAs, developer-supplied files, and your own .mq5 code follow different installation processes. Understanding the difference between .mq5 source files and compiled .ex5 files is important for troubleshooting.
- Correct file placement and configuration matter: EAs and their supporting files must be placed in the appropriate MT5 folders, then refreshed in the Navigator and attached to the correct chart. EA settings can significantly affect how the strategy operates and its risk exposure.
- Test before using an EA live: Installing an EA does not guarantee that it will operate as intended. Review the developer’s requirements, compile the EA successfully if necessary, check its settings and dependencies, and use MT5’s testing capabilities before considering live use.
What you need to know about Expert Advisors
An Expert Advisor is a program that analyzes market data and executes trading operations automatically, given the right permissions. Written for MetaTrader 5 using MetaQuotes Language 5 (MQL 5) and unlike indicators, which mainly analyze and display market information, EAs can execute trades when the necessary permissions are enabled.
Typically, you will receive an EA as a compiled .ex5 and .mq5 files (which is the source code). The .mq5 file is not ready to run until it has been compiled successfully in MetaEditor, generating the corresponding .ex5 executable. When troubleshooting, this distinction matters. If MetaTrader does not recognize an EA, you might have the source code without a compiled executable.
The following sections will guide you through the installation steps:
Prepare the files you need
EAs bought through the MQL5 Market must be installed through MetaTrader’s Market or purchased-products interface, not treated as ordinary files. Market products often require licensing and activation, so manual copying may not work.
If the EA is supplied by a developer, it will likely arrive as an .ex5 file, sometimes inside a ZIP archive. The package also contains .set preset files, custom indicators, libraries, and other components the robot requires.
It is worth noting that a .set file is not an EA per se. A .set file stores input settings, not the EA itself. Do not drop indicators or libraries into the Experts folder; they have different uses.
Furthermore, it is highly encouraged that you read the developer’s documentation prior to installing or running anything. Some EAs require a specific symbol suffix, timeframe, account type, minimum balance, trading session, or additional indicator. Installation is only the first stage of getting the system operational.
Open the MetaTrader 5 data folder
Do not assume that the MT5 program directory is the right place for your EA. Traders often have multiple MT5 installations on the same computer, each with its own data directory. Each terminal can have its own data directory.
Open MetaTrader 5, select File > Open Data Folder, and work from the directory identified by the active terminal. From there, open the MQL 5 folder. From there, open the MQL 5 folder, where MetaTrader specifies the MQL5\Experts directory as the Expert Advisors location.
For third-party EAs, the path will resemble MQL5\Experts, with subfolders for organizing multiple robots. This is useful if you maintain separate systems for forex, indices, commodities, or different trading strategies. The most important point is that the EA needs to be placed in the data folder belonging to the MT5 terminal you intend to run it on.
Install the EA file
Once you have opened MQL5\Experts, copy the EA's .ex5 file into that directory. If the developer has provided supporting files, place them in the locations specified in the accompanying documentation. Do not blindly put every file into the Experts directory. MetaTrader 5 uses separate directories for Expert Advisors, indicators, scripts, and other components, and misplaced dependencies can prevent an EA from loading or operating correctly.
If you receive an .mq5 source file instead of an .ex5 executable, open MetaEditor from within MetaTrader 5. Before the EA can run as an executable program, the source code must be compiled successfully. Press F7 or select Compile in MetaEditor to generate the corresponding .ex5 file.
Pay attention to the compiler output after compiling. If compilation produces errors, the .ex5 executable will not be generated successfully. Errors may indicate problems with the source code, missing dependencies, or compatibility issues. Review any warnings as well, as they can highlight potential programming or compatibility issues that may require further investigation.
Refresh the navigator
Open the Navigator window through View > Navigator (or Ctrl+N). Expand Expert Advisors. Your newly installed EA should appear. If it does not, right-click and hit Refresh.
If the EA still does not appear, the most common cause is a misplaced file in the MT5 data directory. Other reasons could be an MT4 file installed instead of an MT5 file, or a forgotten compilation of a .mq5 source file, or an accidental copy into Indicators or Scripts.
MT4 and MT5 files are not interchangeable, so an .ex4 or .mq4 file will not work as an MT5 Expert Advisor. If you have ruled out the above scenarios and the EA still does not appear, try restarting the terminal.
Attach the EA to a chart
Seeing an EA in the Navigator does not activate it. Open the chart and symbol on which you want it to operate. Drag the EA from Navigator onto that chart. Alternatively, double-click the EA in Navigator to begin the attachment process.
A properties window will appear before the EA starts. This is where the real configuration begins. Depending on the robot, you may see parameters for lot size, stop-loss distance, take-profit levels, risk percentage, trading hours, spread limits, maximum positions, and indicator settings.
Do not change these numbers casually. An EA’s inputs are part of the strategy itself. A robot tested at a fixed 0.01 lot size can behave very differently if you abruptly increase its position size. Changing an indicator period can turn a well-calibrated strategy into something different.
Important: MetaTrader 5 allows only one Expert Advisor to be attached to a particular chart at a time. Attaching another EA to the same chart will replace the EA that is already attached. If you want to run multiple EAs simultaneously, you can use separate chart windows.
Take your automated trading further with FP Markets
With FP Markets, traders can access MetaTrader 5 and use Expert Advisors to automate their trading strategies, with access to a range of trading tools and markets.
Whether you're using your first Expert Advisor or refining an existing strategy, MetaTrader 5 allows you to backtest and test EAs before considering live use. Explore MetaTrader 5 with FP Markets and take the next step towards a more systematic approach to automated trading. Open an account with FP Markets today.
Frequently asked questions (FAQs)
No. MT4 and MT5 use different file formats and platforms, so an .ex4 or .mq5. EA cannot be installed as an MT5 Expert Advisor. You need an EA specifically developed for MT5.
No. After installation, the EA must be attached to a chart and configured with the appropriate inputs and trading permissions. It is best to test the EA on a demo account first before considering live trading.