You can install and use an Expert Advisor (EA) on the desktop versions of MetaTrader 4 (MT4) or MetaTrader 5 (MT5) to automate trading based on predefined rules. To get started, you need to install the Expert Advisor file, enable automated trading, and attach it to a trading chart.
What Do I Need Before Installing an Expert Advisor (EA)?
Before installing an Expert Advisor (EA), make sure you have:
Desktop trading platform: MetaTrader 4 (MT4) or MetaTrader 5 (MT5). Expert Advisors (EAs) cannot run directly on mobile apps.
Compatible file: An .ex4 file for MT4 or an .ex5 file for MT5. Source files (.mq4 or .mq5) must be compiled before use.
Active platform connection: Your trading platform must remain running and connected for the Expert Advisor (EA) to operate.
Steps to Install an Expert Advisor (EA) on MetaTrader 4 (MT4) or MetaTrader 5 (MT5)?
Open MetaTrader 4 (MT4) or MetaTrader 5 (MT5).
Select File → Open Data Folder.
Open the MQL4 folder for MT4 or MQL5 folder for MT5.
Open the Experts folder and copy your Expert Advisor (EA) file into it.
Restart the platform, or right-click Expert Advisors in the Navigator panel and select Refresh.
How Do I Enable Automated Trading and Attach an Expert Advisor (EA)?
Go to Tools → Options → Expert Advisors.
Enable Allow automated trading.
If your Expert Advisor (EA) requires access to an external website, enable Allow WebRequest for listed URL and add the required address.
Click OK to save your settings.
Enable automated trading from the toolbar:
MetaTrader 4 (MT4): Click AutoTrading.
MetaTrader 5 (MT5): Click Algo Trading.
Open the chart of the trading product you want the Expert Advisor (EA) to trade.
In the Navigator panel, locate your Expert Advisor (EA) under Expert Advisors and drag it onto the chart.
Enable automated trading for the Expert Advisor (EA) in its settings window, then adjust the parameters under Inputs as needed.
Click OK to attach the Expert Advisor (EA).
Once enabled, the Expert Advisor (EA) will operate according to its programmed rules while the platform remains running and connected.