Tutorial - Building an EA

Last update: 27 April 2023

If you came here because you're starting the endeavour of building a trading robot (EA), you've come to the right place! This tutorial will focus on building an EA using EA Builder Pro. You can build our example EA by following us in our footsteps, or you can make you own decisions, using the extra information provided by this tutorial.

When trading, you're placing orders at a broker. A broker usually offers a trading platform which allows you to send orders manually. One of the best of such platforms is MetaTrader. Besides manual trading, MetaTrader allows you to install a trading robot, called an "Expert Advisor" (EA). EA Builder Pro helps you build an EA with the greatest of ease (up to 10 times quicker than with our competition).

This tutorial assumes you've got MetaTrader 4 or 5 installed and are fairly familiar with it. If you're not, please start at the Help - Get everything you need page, which will guide you to installing MetaTrader and running your first EA. When you have finished, you should circle back to this page.

Before we begin

This tutorial gives an example of building an advanced EA and the tutorial can feel quite complex as well. If you'd like to start with a medium complexity EA (MT5 only), we'd like to mention that one of our long-term users, Raoul, has written a blog about his EA and how he built it using our tool. Feel free to have a look at Roaul's blog.

How to create an EA using EA Builder Pro?

Let's get started! In this advanced tutorial we will be creating the famous 'Cowabunga' EA. This EA will use the trend on the H4 (4 hour) timeframe to act as a filter and then look at the M15 timeframe for opportunities to go long or short.
Let's write down the entries/ exits, which we call 'Signals' as a general term for a collection of conditions for entries and exits.

  • Open buy signal:
    The filter for going long checks if the trend is up. The trend is up when on the H4 timeframe:
    1. the 5-bar EMA is above the 10-bar EMA
    2. RSI is bigger than 50
    3. Stochastic is moving up but not overbought
    The entry opportunities for going long on the M15 timeframe are:
    1. MACD crosses up the 0 value or
    2. MACD is negative but just started going up
  • Open sell signal:
    The filter for going short checks if the trend is down. The trend is down when on the H4 timeframe:
    1. the 5-bar EMA is under the 10-bar EMA
    2. RSI is smaller than 50
    3. Stochastic is moving down but not oversold
    The entry condition for going short on the M15 timeframe are:
    1. MACD crosses down the 0 value or
    2. MACD is positive but just started going down
  • Close strategy (for buy and sell both):
    We're going to set 50- and 00 price levels as our exit signals' target. So, if the price when opening a buy order is 1.09887, then we will target 1.10000, which is 11.3 pips up. However, if the target is less than 5 pips away only, we will change tactic and set the exit at the distance of the order's open price to the Parabolic SAR. So, if Parabolic SAR is 10 pips under the order's open price, then we will set the exit to 10 pips above the order's open price.
    We will also set the stop loss to the value of Parabolic SAR when SAR is below the order's open price.

Well, that's quite something! The EA you had in mind may be less complicated than that. Actually 9 out of 10 trading strageties are less complicated than the Cowabunga strategy. However, we wanted this tutorial to show EA Builder Pro is capable of creating advanced EA's and at the same time make sure you learn enough to create advanced EA's yourself. If you just started building EA's and notice during this tutorial that you have questions and need additional help, please Subscribe and send us your questions. Now, let's continue!

Next: Part 1 : Get started.