How to run an EA in MetaTrader?

5 Oktober 2023

We often get the question of how to run an EA in MetaTrader. This is a step-by-step instruction.

Jump to instructions for MT4 or MT5

MetaTrader 4

Step 1: Copying files

  1. Download your EA by clicking 'Export to MetaTrader 4'.
  2. Click 'Compiled' to download the 'ex4' file, or 'MQL' (subscribers only) to download the 'mq4' file.
  3. Go to the folder where the file is downloaded, right-click the file and choose 'Copy'.
  4. Launch MetaTrader 4.
  5. In MetaTrader, go to 'File', 'Open Data Folder'.
  6. Open the 'MQL4' folder, then the 'Experts' folder.
  7. Paste the file you copied.
  8. This step is for if you downloaded the mq4-file only: double-click the file. Wait for MetaEditor to open the file. Click 'Compile' in the menu bar.
  9. Go back to MetaTrader 4.
  10. In the 'Navigator' panel, right-click 'Expert Advisors' and choose 'Refresh'.

Step 2: Adjusting settings

  1. In MetaTrader 4, go to 'Tools', 'Options' and open the 'Expert Advisors' tab.
  2. Make sure the 'Allow automated trading' checkbox is enabled. Mind you that if you leave the 'Disable ...' checkboxes enabled, the EA will be disabled automatically when you perform these actions. It's entirely up to you if you want that to happen.
    Options expert advisor MT4
    Options - Expert advisor MT4
  3. click the 'OK' button.

Step 3: Run EA on Demo/ Live

  1. You can now drag-and-drop your EA, from the Navigator panel on the chart.
  2. When the EA window pops up, please verify that in the 'Common' tab the 'Allow live trading' checkbox is enabled.
    Common expert advisor MT4
    Common - Expert advisor MT4
  3. Click the 'OK' button.
  4. Verify that in the top right corner of the chart you see a happy face.
    Common expert advisor MT4
    Expert advisor MT4 successfully running
  5. If you don't see a happy face, please open the 'Terminal' panel and look at both the 'Experts' tab and the 'Journal' tab for any error message which will tell you why the EA isn't running.

MetaTrader 5

Step 1: Copying files

  1. Download your EA by clicking 'Export to MetaTrader 5'.
  2. Click 'Compiled' to download the 'ex5' file, or 'MQL' (subscribers only) to download the 'mq5' file.
  3. Go to the folder where the file is downloaded, right-click the file and choose 'Copy'.
  4. Launch MetaTrader 5.
  5. In MetaTrader, go to 'File', 'Open Data Folder'.
  6. Open the 'MQL5' folder, then the 'Experts' folder.
  7. Paste the file you copied.
  8. This step is for if you downloaded the mq5-file only: double-click the file. Wait for MetaEditor to open the file. Click 'Compile' in the menu bar.
  9. Go back to MetaTrader 5.
  10. In the 'Navigator' panel, right-click 'Expert Advisors' and choose 'Refresh'.

Step 2: Adjusting settings

  1. In MetaTrader 5, go to 'Tools', 'Options' and open the 'Expert Advisors' tab.
  2. Make sure the 'Allow automated trading checkbox is enabled. Mind you that if you leave the 'Disable ...' checkboxes enabled, the EA will be disabled automatically when you perform these actions. It's entirely up to you if you want that to happen.
    Options expert advisor mt5
    Options - Expert advisor MT5
  3. click the 'OK' button.

Step 3: Run EA on Demo/ Live

  1. You can now drag-and-drop your EA, from the Navigator panel on the chart.
  2. When the EA window pops up, please verify that in the 'Common' tab the 'Allow Algo Trading' checkbox is enabled.
    Common expert advisor mt5
    Common - Expert advisor MT5
  3. Click the 'OK' button.
  4. Verify that in the top right corner of the chart you see a blue hat. If it's gray, the EA is disabled.
    Common expert advisor mt5
    Expert advisor MT5 successfully running
  5. If you don't see a happy face, please open the 'Terminal' panel and look at both the 'Experts' tab and the 'Journal' tab for any error message which will tell you why the EA isn't running.