MetaTrader 4 tutorial

How to Install an Expert Advisor in MT4

Add an Expert Advisor to MetaTrader 4, attach it to a chart, allow it to trade and confirm it's running.

Beginner About 10 min(estimate) 7 stepsUpdated

Times are estimates — they vary with your computer, connection and experience.

Before you start

  • MetaTrader 4 installed and logged in — see How to Install MetaTrader 4.
  • The EA's MT4 file: a compiled .ex4 (and sometimes .mq4 source). Extract .zip downloads first.
  • Any extra files the developer supplies: .set presets, or files for the Libraries folder.
  • Ideally a demo account for the first run.

What you'll learn

  • Install the EA files in the correct folders.
  • Attach the EA with live trading allowed.
  • Confirm in the logs that it's running.

Steps

  1. Step 1: Open the data folder

    In MT4, go to File → Open Data Folder, then open MQL4 → Experts.

  2. Step 2: Copy the EA files

    Paste the .ex4 (and .mq4, if provided) into Experts. Put library files the developer mentions in MQL4\Libraries and .set files in MQL4\Presets.

  3. Step 3: Refresh the Navigator

    Open the Navigator (Ctrl+N), right-click Expert Advisors and choose Refresh, or restart MT4.

  4. Step 4: Attach it to a chart

    Open a chart for the symbol and timeframe the documentation specifies and drag the EA onto it (or double-click it).

  5. Step 5: Allow live trading

    In the properties window, open the Common tab and tick Allow live trading. Only tick Allow DLL imports if the developer says the EA needs it and you trust the source.

  6. Step 6: Set the inputs

    On the Inputs tab, adjust settings or click Load to import a .set file. Pay particular attention to lot size and risk.

  7. Step 7: Enable AutoTrading

    Click OK and make sure the AutoTrading button on the main toolbar is on. The EA's name appears in the chart's top-right corner with an icon showing whether it may trade.

Expected result

The EA's name is in the top-right of the chart with its trading-allowed icon, and the Experts tab of the Terminal window (Ctrl+T) shows it loaded successfully.

Troubleshooting

The EA isn't in the Navigator
It must be an .ex4 inside MQL4\Experts of the data folder. Refresh the Navigator or restart MT4.
Error 4109 in the Experts tab
Trading isn't allowed: switch on the toolbar AutoTrading button and tick Allow live trading in the EA's properties (F7).
"DLL calls are not allowed"
Enable Allow DLL imports for this EA — only if you trust its developer.

Next tutorial

How to Read the MT4 Experts and Journal Logs

Use the MT4 Experts and Journal tabs to see what your EA and terminal are doing, open the log files on disk, and copy the right lines for support.

Continue

Related tutorials

All tutorials
  • Forex Bots & EAsIntermediate

    How to Configure Expert Advisor Settings

    Configure an Expert Advisor's inputs in MT4 or MT5: lot size and risk, stop-loss units, magic numbers and spread limits, plus saving and loading .set files.

    About 20 min(estimate) 7 steps
  • Forex Bots & EAsIntermediate

    How to Troubleshoot an EA That Isn't Trading

    Work through the checks that fix most idle Expert Advisors in MT4 and MT5: permissions, market hours, the logs, broker rejections, filters and inputs.

    About 20 min(estimate) 8 steps