How to create your own forex EA

Forex EA (Forex Expert Adviser or Auto trader)

Forex EA or Expert adviser or Auto trader is a computer program which can automate your trading. If you are trading manually with your own strategy, you can create an Forex EA which uses the same strategy or trading logic to execute the trades.

How does a Forex EA work?

As mentioned above, EA (Expert adviser) is a computer program written in a programming language. You need to run it with trading platform. EA opens, closes and modifies trading orders as instructed in the program. As you know, Forex market run 24 hours 5 Days, Your computer or server must run all this time, if your EA monitor the market all the time. So basic requirements to run an EA are.

  1. A computer system which runs 24Hrs/5days. (This depends on your strategy. If you check the price levels only once a day and place orders, you don’t need a system runs 24/5.)
  2. Uninterrupted power and internet connection.
  3. Enough memory and CPU in your system to support the program
  4. Trading platform which supports your EA (Otherwise , you select an EA which runs in your trading platform)

MQL5 and MQl4

MQL5(MetaQuotes Language 5) and MQL4 are programming languages which you can use to write your EA to run in metatrader4 (mt4) or metatrader5 (mt5). MT4 and MT5 are the most widely used trading platforms. You can write your program in the mql5 or mql4 and back test in these trading platforms.

mql5 is not updated version of mql4. It is almost different from mql4. So you can not run an EA written in mql4 language in MT5 trading platform.

How to start with EA programming

It is recommended that you know basics of programming to understand how to write an EA. If you are new to programming, please go through basics of python language which is a very easy programming language to begin with.

Now, to try making your own EA, Download MT5 or MT4 from their respective sites.

MT5 :

MT4 :

After installation, you can see Metaeditor5 icon on your desktop, this is what we are going to use to write our own EA.

First EA program

It is better to try Metaeditor5 defaults to create your first program. Lets try to make an EA


  1. Open metaeditor5

Forex EA MetaEditor5

2. Click on “New”

Forex EA

3. Select expert generator

Forex EA4. Select the parameters, indicators, trailing stops, money management.

Forex EA

5. Run the EA in test mode.

Back testing your EA

Back testing is provided in metatrader. So you can run your EA in custom period and test the success rate. You can also optimize your EA, to find out the best values of indicators which gives best result.

Forex EA

Helping forums

There are dedicated internet forums for mql5 and mql4 programming. A lot of free EAs are provided in mql5 code base, which you can download and try it in your system.

Link to mql5 code base :

Advantages of Forex EA or autotrading

Major advantages are

  1. It takes away emotions from trading. It is considered as the major drawback of manual trading.
  2. An autotrader can run 24hrs a day and for years until you shutdown the system.
  3. Forex EA can work on very small time frame, and that too for years!.
  4. No manual errors or delay. Execution speed depends only on internet connection speed.
  5. It is not completely out of your control, you can interrupt the program when you want.

Forex Signal Providers

If you can make a successful EA, not only you can earn from it, but also you can use it as a signal provider. There are many websites like, or in mql5 signals.


For more updates Follow tradingol in facebook , twitter and Stocktwits.

Leave a Reply

%d bloggers like this: