MetaTrader 5 Guide

Install an EA and enable automated trading

This guide covers compiled .ex5 Expert Advisors for MetaTrader 5. Complete a backtest and forward test on a demo account before considering live use.

Required softwareMetaTrader 5 Desktop Client
File formatEA compiled file .ex5
Recommended environmentDemo account + VPS stable operation
1

Download the EA file

Download the required .ex5 file from the Free EA page. Do not change its file extension.

2

Open the MT5 data directory

Open MT5 and select “File” → “Open Data Folder” from the top menu.

  • Do not look directly for the MT5 installation directory, multiple terminals may use different data directories.
  • After entering the data folder, open it in sequence MQL5 and Experts
MT5 → File → Open data folder → MQL5 → Experts
Open Data Folder option in MT5 File menu
Click "Open Data Folder" in the "File" menu.
3

Copy the EA and refresh Navigator

Copy the downloaded .ex5 file into MQL5/Experts.

  • To return to MT5, press Ctrl+N Open Navigator.
  • Right-click "EA Trading" or "Intelligent Trading System" and select "Refresh".
  • If it still doesn't show up, completely close and restart MT5.
List of Expert Advisors in MT5 Navigator
Press Ctrl+N to open the navigator and find the installed file in "Expert Advisor".
4

Add EA to chart

Open the target symbol and timeframe, then drag the EA from Navigator onto the chart.

  • Confirm the variety name e.g. XAUUSDXAUUSDm or other broker suffixes.
  • Check "Allow algorithmic trading" on the "Common" tab.
  • Check Lot Size, Stop Loss, Take Profit, Maximum Position and Magic Number in the "Inputs" tab.
  • When running multiple EAs on the same account, each instance should use a different Magic Number.
Do not directly use the default large lot size without understanding the meaning of the parameters. Grid and Martingale strategies in particular require limits on maximum positions, total lot size, and equity drawdowns.
5

Enable automated trading in MT5

After allowing trading in the EA settings, enable MT5’s global automated-trading switch as well.

  • Click the "Algorithmic Trading" or "Algo Trading" button on the toolbar to enable it.
  • You can also go to "Tools" → "Options" → "EA Trading" and check "Allow algorithmic trading".
  • If the EA requires network authorization or reading interface, add the URL provided by the developer in "Allow WebRequest to access the following URL".
Ordinary offline EA usually does not need to enable DLL or WebRequest. Don't allow unknown DLLs unless you know exactly what they are used for.
Allow algorithmic trading settings in MT5 EA trading options
Check "Allow algorithmic trading" in "Tools → Options → Expert Advisor".
6

Confirm that the EA is running

An EA does not necessarily place an order immediately after loading; it may be waiting for its entry conditions.

The EA name is displayed in the upper right corner of the chart
Global algorithmic trading button is enabled
"Expert" log has no initialization errors
Symbol, period and Magic Number correct
The account allows EA automated trading
Margins, spreads and trading hours are normal

according to Ctrl+T Open the toolbox and focus on checking the error messages in the "Experts" and "Log" tabs.

7

Backtest first, then use a demo account

Press Ctrl+R to open Strategy Tester, then select the EA, symbol, timeframe, and test period.

  • Use spread and quote data that is as close to the real environment as possible.
  • Check maximum drawdowns, margin usage, consecutive losses and extreme market performance.
  • After passing the backtest, conduct forward testing on a demo account for at least a period of time.
  • Real operation requires keeping MT5, network and computer online; long-term operation is recommended to use VPS.
Historical performance is not indicative of future results. Automated trading does not eliminate market risk and does not guarantee profitability.
?

Troubleshooting

If the EA is missing, not trading, or stops running, check the following items in order.

  • Navigator without EA:Confirm that the file is located in the data directory of the current terminal, not the software installation directory.
  • Unable to load:Confirm the file is for MT5 .ex5, MT4 .ex4 Not available in MT5.
  • No automated trading:Check global automated-trading switches, EA common settings and account permissions.
  • No order:It's possible that the strategy signal hasn't been met yet, check the "expert" log instead of repeatedly reloading.
  • Invalid volume:The lot size does not meet the broker's minimum lot size or step size.
  • Market closed:The current product is closed or not available for trading.
  • WebRequest error:Include correct HTTPS domain name in MT5 options.

MT5 EA Installation, Setup and Algo Trading Guide

This tutorial covers downloading, copying files, refreshing Navigator, attaching the EA to a chart, enabling algo trading, backtesting and demo validation.