Skip to content

Run your first EA

Welcome to the official EA Builder Pro - How to run your first EA - tutorial. You can have your first trading bot (EA) up and running on your desktop computer within the next 30 minutes, simply by following this step-by-step tutorial.

In short:

  1. Install MetaTrader and open a demo account.
  2. Add an EA from a template in EA Builder Pro and export it.
  3. Copy the EA to MetaTrader and allow automated trading.
  4. Backtest it in the Strategy Tester, then run it on a chart.

If you already have MetaTrader installed and downloaded your EA, skip to Get EA ready to run.

Every broker has its own MetaTrader installer. We will create an account and install MetaTrader with Switch Markets. Unsure why? Read why you should.

  1. Sign up and enter your information. From our experience, you won’t be contacted by their sales department, a practice common among many brokers. You will get e-mails though.

    broker account creation
    Enter your information to open an account
  2. Upload the additional documents you are asked for. You don’t need a credit card to open an account and test your EAs. If you decide to deposit, you get free bonuses, as discussed before.

  3. Once you are logged in, click Downloads and select your OS and MetaTrader version. We recommend MT5. Run the installer.

    download metatrader
    Download the MetaTrader installer
  4. Start MetaTrader. It asks you to log in; you get the login details in the next step.

    log in to metatrader
    MetaTrader asking for log in information.
  5. Back on the Switch Markets website, create a Demo account (and a Live account when you’re ready):

    • Standard: no commission per lot, but a larger spread.
    • Pro (ECN): the smallest spread, with a commission per lot. We prefer a Pro account. The best choice depends on what your EA is optimized for.
    metatrader account creation
    Create your MetaTrader account
  6. You see “Your account [Account number] has been successfully created”, with a password; you also get them by e-mail. Log in to MetaTrader with them. The charts load, and MetaTrader is ready for manual trading. We’ll enable automated trading in a moment.

You don’t need to build your own perfect EA yet: add one of our templates, export it and run it.

  1. Open our webtool. Check that the platform button in the app bar shows the platform you installed: MT4 or MT5.
  2. Click + Add Expert Advisor and choose Template.
  3. Choose a template without a Pro label, for example Moving average MT5. Don’t choose Blank: a blank EA doesn’t trade.
  4. Click Add Expert Advisor. Your EA opens in the EA editor.
Select a template step of the wizard with a list of template EAsSelect a template step of the wizard with a list of template EAs
Choose a template for your first EA.

See Add a new Expert Advisor for all the options.

Click Export to MetaTrader 5 (or 4) and choose:

  • Compiled EA (.ex5): ready to run in MetaTrader. Available on every plan.
  • MQL Source code (.mq5): the source code, which you compile in MetaEditor. Needs a Pro subscription.
Export menu with Compiled EA, MQL Source code, Indicators, Run on VPS and How to installExport menu with Compiled EA, MQL Source code, Indicators, Run on VPS and How to install
The export menu.

Exported the source code? Double-click the downloaded file: MetaEditor opens it. Click Compile to turn the .mq5 file into an .ex5 file.

metatrader compile eametatrader compile ea
Compile your mq5 file to an ex5 file

See Export to MT4 / MT5 for more.

  1. In MetaTrader, click File > Open Data Folder.
  2. Open the MQL5 folder (MT4: MQL4), then the Experts folder.
  3. Move the downloaded file into it.
  4. In the Navigator panel, right-click Expert Advisors and click Refresh. Your EA is in the list.

Before you can run your EA, allow MetaTrader to trade automatically.

  1. In MetaTrader 4, go to Tools > Options and open the Expert Advisors tab.
  2. Check Allow automated trading. If you leave the Disable … checkboxes checked, the EA is disabled automatically when you do those actions. It’s up to you whether you want that.
  3. Click OK.
Options expert advisor MT4Options expert advisor MT4
Options - Expert advisor MT4

Now test the EA on past prices in MetaTrader’s Strategy Tester.

  1. Open the Strategy Tester panel (MT4: Tester). Not visible? Go to View and select it.
  2. Select your EA, a symbol and a period.
  3. Enable Visual mode with the display of charts, … to see what the EA does. It’s the best way to see the EA at work, but much slower than without.
  4. Click Start. The EA opens orders on the chart.
metatrader first ea runmetatrader first ea run
EA ran and orders were opened

When the test is done, the Backtest tab of the Strategy Tester shows the result.

You can also backtest in the cloud, without MetaTrader and without exporting: click Run backtest in the EA editor. The report shows the result of your EA: the key figures, the balance, when it traded, how long positions were open, and all the statistics and inputs.

Backtest report with the key figures, the Balance chart, Entries and results, Position holding time, MFE and MAE, Statistics and InputsBacktest report with the key figures, the Balance chart, Entries and results, Position holding time, MFE and MAE, Statistics and Inputs
The report of a backtest in EA Builder Pro.

See Run a backtest and Read your backtest results.

Now that we know the EA works, run it on a real-time chart. Do this later for your own EA too, to check that it runs well in real-time trading. Start on a demo account.

  1. Drag your EA from the Navigator panel onto a chart.

  2. In the window that opens, on the Common tab, check Allow live trading.

    Common expert advisor MT4Common expert advisor MT4
    Common - Expert advisor MT4
  3. Click OK.

  4. Check that a happy face shows in the top right corner of the chart.

    Common expert advisor MT4Common expert advisor MT4
    Expert advisor MT4 successfully running

No happy face? Open the Terminal panel and look at the Experts and Journal tabs: an error message tells you why the EA isn’t running.

MetaTrader is a registered trademark of MetaQuotes Ltd. EA Builder Pro is not affiliated with MetaQuotes.