Expert Advisor(EA):MQL5 Trading Robots Development Part 1

Table of Contents

Introduction

Download the trading software from https://www.roboforex.com/forex-trading/platforms/metatrader4-mt4/.

Once you get the software installed, you can see two icons on your desktop.

Trader and code editor

You can click either button to get your coding started. If you open the trader, you can open the editor from the trader by clicking the book-like button circled below. Moreover, if you have already set your robot trader up, you can enable autotrading by activating the “AutoTrading” button, which I will discuss in detail later.

Login and location of editor

Your first trading robot

Once you have opened the editor, right-click the files in Experts and click the New File button.

N.B. If you right-click on Experts, you can get your file somewhere else.

Tick Expert Advisor and click Next.

Fill in your trader name, your name, and your website. The parameters are optional. Those parameters can be modified through the trader window, so there is no need to change the code.

You can tick those options to add an empty function to the code template. Here, we leave them unticked and click Next.

After all those procedures, you can get sample code like this. We will build our robot trader from these simple scaffolds.

You can compile this empty file by clicking the Compile button.

Then open the trader and enable Strategy Tester from View in the menu.

Now you can see your trader. You can leave the options at their defaults and click Start. However, your code will do nothing because there is no action in it, so a horizontal line will be generated, meaning there is no fluctuation in your virtual fund.

In the next blogs, I will talk about how to develop a robot trader that can achieve a profit curve like this. Furthermore, I want to mix EA with machine learning to create a more robust trader.

Leave a Reply