Forex trading courses nyc

How to create forex trading robot

How to Create Forex Robot or Expert Advisor (I can do it),Do you want to create Forex EA without programming?

Do not worry, my name is Petko Aleksandrov, the Chief trader at EA Forex Academy, and in this article, I will share with you what is the easiest way to create Forex EA without programming. Points to follow to create your robot. Create an algorithm with trading rules; Steps to creating your first robots with EA builder; Backtest the strategy; Optimize the strategy; Save your forex 22/4/ · Another solution to create a trading robot is using a software. There are software programs that we use to automate the strategies without programming skills. This is indeed a ... read more

As you can see, we haven't used moving average indicators yet. We found a simple rule - as many parameters are stated in the handle of the module, so many methods and members should be in the class that implements the module. There is nothing complicated! However, don't forget to set default values of parameters on the constructor. In our case, we must check the periods of moving averages and the type of smoothing for their calculation.

For this purpose you should write your own ValidationSettings method in the class. This method is defined in the parent class CExpertBase , and in all its children it is obligatorily redefined. But if you do not know anything about object-oriented programming, just remember - in our class we should write the ValidationSettings function, which requires no parameters and returns true or false.

First comes the return type, then the class name, then scope resolution operator ::, and all this is followed by the name of the previously declared method. Do not forget that the name and type of parameters must match in the declaration and description of the class method. However, the compiler will warn you of such an error. If you do not add this line, the generated Expert Advisor will not be able to initialize our module of trading signals.

It's time to work with the indicators, since all the preparatory work with the parameters for them have been completed. Each module of trading signals contains the InitIndicators method, which is automatically called when you run the generated Expert Advisor.

In this method, we must provide indicators of moving averages for our module. First, declare the InitIndicators method in the class and paste its draft:.

So there is nothing complicated, we declare the method and then simply create the method body, as we have done for the ValidationSettings method. Above all, do not forget to insert the class name and the operator :: in the function definition. We have a draft, which we can insert into a code to create moving averages. Let's do this properly - for each indicator we create a separate function in the class, which returns true if successful.

The function can have any name, but let it reflect its purpose, so let's call the functions CreateFastMA and CreateSlowMA. That is why a pointer to a variable of type CIndicators is passed as a parameter. The following is written in Documentation about it:. The CIndicators is a class for collecting instances of timeseries and technical indicators classes. The CIndicators class provides creation of instanced of technical indicator classes, their storage and management data synchronization, handle and memory management.

This means that we must create our indicators and place them in this collection. Since only indicators of the CIndicator form and its children can be stored in the collection, we should use this fact. We will use CiCustom , which is the above mentioned child. For each moving average we declare an object of type CiCustom in the private part of the class:. Of course, you can create your own indicator class, which will be derived from CIndicator , and implement all the necessary methods for use with the MQL5 Wizard.

But in this case we want to show how you can use any custom indicator in the module of trading signals using CiCustom. Then declare the MqlParam structure, which is especially designed for storing parameters of custom indicators, and fill it with values. We use Custom Moving Average from the standard terminal delivery pack as the custom MA indicator.

Since Custom Moving Average. If you look at the code for this indicator, you can see all the required data:. And the last one is specifying the number of indicator buffers using the NumBuffers method. The CreateSlowMA method for creating the slow moving average is simple. When using custom indicators in the module, do not forget that the Expert Advisor generated by the MQL5 Wizard will also run in the tester. If we use several different indicators, we should add this line for each of them.

So, we have added the indicators. For more convenience, let's provide two methods of receiving MA values:. As you can see, the methods are very simple, they used the GetData method of the SIndicator parent class, which returns a value from the specified indicator buffer at the specified position.

If you need classes for working with classical indicators of the standard package, they are available in section Classes for working with indicators. We are ready to proceed to the final stage. Everything is ready to make our module work and generate trading signals.

This functionality is provided by two methods that must be described in each child of CExpertSignal :. If the function returns a null value, it means that there is no trading signal. If there are conditions for the signal, then you can estimate the strength of the signal and return any value not exceeding Evaluation of the signal strength allows you to flexibly build trading systems based on several modules and market models. Read more about this in MQL5 Wizard: New Version. Since we are writing a simple module of trading signals, we can agree that the buy and sell signals are valued equally Let's add necessary methods in the class declaration.

Also, let's create the description of functions. This is how the buy signal is checked it's all the same with the sell signal :. Note that we have declare the idx variable, to which the value returned by the StartIndex function of the parent class CExpertBase is assigned. The StartIndex function returns 0, if the Expert Advisor is designed to work on all ticks, and in this case the analysis starts with the current bar.

If the Expert Advisor is designed to work at open prices, StartIndex returns 1 and the analysis starts with the last formed bar. By default StartIndex returns 1 , which means that the Expert Advisor generated by the MQL5 Wizard will only run at the opening of a new bar and will ignore incoming ticks during formation of the current bar. How to activate this mode and how it can be used will be described later in the finishing stroke. The module is ready for use, so let's create a trading robot in the MQL5 Wizard based on this module.

To test the efficiency of our module, let's generate an Expert Advisor based on it in the MQL5 Wizard and run it on the chart. All other parameters have also been added by the MQL5 Wizard while generating the EA based on the selected money management module and position maintenance module Trailing Stop.

Thus, we only had to write a module of trading signals and received a ready solution. This is the main advantage of using the MQL5 Wizard!

Now let's test the trading robot in the MetaTrader 5 Strategy Tester. Let's try to run a quick optimization of key parameters. In these settings of input parameters, more than half a million of passes is required for full optimization. Therefore, we choose fast optimization genetic algorithm and additionally utilize MQL5 Cloud Network to accelerate the optimization.

The optimization has been done in 10 minutes and we have got the results. As you can see, creating a trading robot in MQL5 and optimization of input parameters have taken much less time than would be required for writing the position management servicing logic, debugging and searching for the best algorithms.

You can skip this item or go back to it later when you are completely comfortable with the technique of writing a module of trading signals. Based on this variable, the StartIndex function returns its value.

It communicates to the Expert Advisor the mode it should run in. Do this only if you understand how it works. Not all trading systems are designed to work inside the bar. If you have mastered MQL5, then you no longer need to write an Expert Advisor from scratch. Just create a module of trading signals and, based on this module, automatically generate a trading robot with the enabled trailing and trade volume management modules.

And even if you are not familiar with OOP or do not want to delve much into the structure of trade classes, you can just go through 6 steps:. Each step is simple and requires little skill in MQL5 programming. You only need to write your module once, following the instructions, and further verification of any trade idea will take no more than an hour, without tiring hours of coding and debugging. Remember that the trading strategy implemented by your trading robot created using the MQL5 Wizard, is as complex as the module of trading signals it uses.

But before you start to build a complex trading system based on a set of rules for entry and exit, split it into several simple systems and check each one separately. Based on simple modules you can create complex trading strategies using the ready-made modules of trading signals, but this is a topic for another article! Translated from Russian by MetaQuotes Ltd. Many articles attached source codes, but many of them can not be compiled correctly. This article is very good because I downloaded it and compiled without an error neighter a warning!

I have a question. When I run the code in the strategy tester , I get. You agree to website policy and terms of use. MetaTrader 5 Examples Indicators Experts Tester Trading Trading systems Integration Indicators Expert Advisors Machine learning Statistics and analysis Interviews MetaTrader 4 Examples Indicators Experts Tester Trading Trading systems Integration Indicators Expert Advisors Statistics and analysis.

Do you like the article? Share it with others — post a link to it! Use new possibilities of MetaTrader 5. Similar articles Population optimization algorithms: Particle swarm PSO DoEasy. Controls Part 21 : SplitContainer control. Panel separator DoEasy. Controls Part 20 : SplitContainer WinForms object Developing a trading Expert Advisor from scratch Part 29 : The talking platform DoEasy.

Controls Part 19 : Scrolling tabs in TabControl, WinForms object events. One More Time about the MQL5 Wizard The world around us is changing rapidly, and we try to keep up with it. Five Terrible Classes True, the MQL5 Wizard greatly simplifies the creation of Expert Advisors, but first you need to learn what will be used as input for it.

To automatically create an Expert Advisor using the MQL5 Wizard, make sure that its components adhere to five basic classes of the section Base Classes of Expert Advisors : CExpertBase is a base class for four other classes. CExpert is the class for creating a trading robot; this is the class that trades. CExpertSignal is a class for creating a module of trading signals; the article is about this class.

CExpertTrailing is a class for trailing a protecting Stop Loss. CExpertMoney is the money management class. Creating a Class from Scratch We will not alter any existing module of trading signals to our needs, because it's the way to get confused.

Fill in the fields: Class Name - the name of the class. Base Name is the class from which our class is derived. And we should derive it from the base class CExpertSignal. We only need to add the include declaration to the resulting file so that the compiler knows where to find the base class CExpertSignal include ".. com" property version "1. A Handle to the Module Our class is completely empty, it has no errors and we can test it - let's try to create a new Expert Advisor in the MQL5 Wizard based on it.

Compare: The last block in the handle refers to the module parameters, the first line contains the name of the module to be displayed in the MQL5 Wizard. Thus, the handle of each module contains the following entries: Title - the module name to be shown in the MQL5 Wizard. Type - the version of the module of signals. It must always be SignalAdvanced. Name - the name of the module after its is selected in the MQL5 Wizard and is used in comments for describing internal parameters of the generated Expert Advisor preferably specified.

For the purpose of this lecture, I am not going to use it at the moment. The strategies fulfill the acceptance criteria — simple words the Forex Robot to have predefined limitations. We can add many things to the acceptance criteria. I like to use the most Profit Factor. It is calculated when we devide all the profits by all the losses. I always want to trade with strategies that have Profit facotr bigger than 1. I will leave it this way.

You can add some more criteria if you want the strategy and what this means? If I go back to the generator that it will show only strategies that fulfill the acceptance criteria. For a few seconds I have many strategies calculated and already have some strategy into my collection as a Forex robot. The longer I run the Generator the more strategies I will have and I will have a better chance to find a very nice and profitable Forex robot. Of course, you can add different filters, profit factor as well I prefer to stay at 1.

I prefer to remain at 1. The other filter that I usually use here is a maximum of consecutive losses. For example, if I place 20, I will have more strategies into the collection 7 out of the 70, if I place ten they will call lower, and if I place 15 you will see that I have only 7, and if I put 5, for example, only one strategy will pass. I will leave this generator working for the whole night, and tomorrow, I will see the final results.

But if I decide to use any of the strategies I can easily export them as Forex robots for MT4 or MT5. And I will leave it for minutes to work and to generate strategies for me. The Expert Advisor Studio just generated more than 11, strategies for about 5 minutes and I have 96 into the collection. Just what I was showing you as an example. But here is an exit condition, and if I click over the chart, you can see the indicators. And you can see exactly where the trades happened, where was the entry, where was the exit for all of the periods:.

And for each strategy, you have the indicator chart, the balance chart, the equity, and you have the journal. Here are the actual trades that happened during the tested period. And we have all the statistics for the Forex robot. Net balance, maximum drawdown, return to drawdown ratio, count of trades, ambiguous bars, profit per day on an average basis, win to loss ratio, Sharpe ratio, and so on, so many things that I am not going into detail.

But the idea here is that we do this automatically. The Expert Advisor Studio calculates for us the strategies. We need to set up the inputs that we want, the criteria that we want. And these strategies must be created over the same server where I will be trading.

But the important thing here is to make it on a separate browser. Because this way, EA Studio works faster. I will just login in as well. And I will do the same generation for the other cryptocurrency Forex robot. Also, for the H1 chart and then I will go to strategy properties, here 0. I go back to the generator. I always put the minimum as a spread, and here I give it a more significant range so that I will use this as a minimum as well for the Take Profit. The generator settings also minutes here.

I click on Start, and now the generator will start creating strategies. So, from here, I choose Pepperstone Demo 1, and here I choose Ethereum. The spread was , go to generator I choose the wanted cryptocurrency. You see that this way I really do not need Expert Advisor Coder or anyone with IT skills to do the work for me. It is awesome!

I will put a minimum of as I said this is the spread, another more significant number here and then here. And the last one I will open one more browser. I go to the EA studio. Here I have as a spread. Because this is in pips to make sure I am clear. Strategy properties, so the minimum is the spread here, is exactly like that.

I will give a little bit a more significant range again. I will go to 0. I am going to the generator, I click on start, and now I have these 4 generators as you can see working over here and I will leave them over the night.

Tomorrow morning what I will have? I will have ready strategies into the collection, already hundreds of strategies; these are different strategies. What do we do after that? We select the best ones, and we place them on a demo account for trading, and after that, we follow their performance.

I will show you how we follow the performance of the Expert Advisors, and we place on a separate live account only the best Expert Advisors. But I can afford to do that just because I know how to create MT4 robot that works great and I do it easily with EA Studio. Because even we have some strategies for manual trading, they are not so many.

And actually, to automate this whole process takes so much time if I use, for example, developers because I was using this system for a long time, I was giving strategies to developers to automate them as Forex robot. Obviously this was a horrible process, it was taking so much time and so much money. With the strategy builders, we eliminate the mistakes, and we are sure into the code. And obviously, this gives us the opportunity to trade a portfolio of different strategies.

I will select the best three strategies from Bitcoin, the best three strategies from Ethereum, the Lite, and the Dash. In other words, I will have 12 different strategies on four different cryptocurrencies, and I will place them in the same trading account, which will give me a good diversification of the risk. I will not put all the risk into one strategy, into one Forex robot, into one cryptocurrency, but I will divide the risk, I will diversify the risk.

This is pretty much about it. There are free videos over the internet on how to use EA studio. There is so much more information about each one section, I just showed you in this article the very basic, so you can have an idea what are the strategy builders, how we create strategies, hundreds of strategies, actually thousands of strategies. So now you know how to create MT4 Robot. I show in the Cryptocurrency Trading Course — from A to Z how I export the strategies and how I put them on Meta Trader for trading.

The last option is to learn to Forex robot programming, but this is not what I like to do. I am a trader, not an IT. Want to create a Forex robot without programming?

What about downloading our EA robot and try it out for free! There are three ways to create a Forex robot. One is to code it by yourself on MQL in MetaTrader. The second is to hire a developer to automate your strategy.

The third is to use a Forex strategy builder and export the ready code. These are automated trading strategies. The rules for entry and exit are coded and ones the Robot is attached to the chart it opens and closes the trades automatically. When the traders use Forex robots they avoid the emotions in trading which is the main reason why many loose on the market. Also, the trader spends less time in front of the monitors. The best Forex robot is the one that is created by yourself over historical data of your broker.

Robustness tests are recommendable before start trading. Tag: bitcoin , bitcoin trader , bitcoin trading , cryptocurrency , cryptocurrency course , cryptocurrency trading , cryptocurrency trading course , dash , dash trading , EA Forex Academy , ea studio , ethereum , ethereum trader , ethereum trading , expert advisor , expert advisor studio , expert advisors , litecoin , litecoin trading , trader , trading , trading course.

I have created the Academy in The best method to learn nowadays is online, and I have specialized in recording online trading courses, which brings the traders what they need to start trading professionally. I am happy to share s of Expert Advisors in my courses for free so that everyone can practice algo trading. With my team, we do our best to create high-quality education, review platforms, and brokers and help everyone to stay on the profitable side.

SIGN UP. Expert Advisors. Do you want to create Forex EA without programming? Now I am ready to work with EA Studio How to create Forex Robot? export historical data from your broker for the asset you want to trade generate strategies with the data with predefined acceptance criteria filter the strategies in the collection and select the best performers export the strategy you wish to trade as a Forex Robot Forex robot is every strategy that is automated properly in order to open and close trades according to predefined rules.

What is the generator? Generator outlook The gener ator is an automated process based on the history data we have imported in the strategy builder, which will generate strategies for us. I will go quickly over the menu in EA Studio. What will happen after the generator starts working? This means that we put entry conditions for buy: Strategy inputs. How to create a Forex robot with different conditions for the indicators?

Now for every Forex robot, there is the optimizer: Optimizer menu with steps for optimization This means that I can optimize strategy inputs before creating a Forex EA.

The other tool is the Monte Carlo which is a test for robustness for each Forex robot: Monte Carlo We have Multi-Market. Portfolio trading is unique for EA studio.

Many traders get frustrated when they start looking for how to create trading robots in MT4. Do not worry, my name is Petko Aleksandrov, the Chief trader at EA Forex Academy, and in this article, I will share with you what is the easiest way to create Forex EA without programming.

In the Academy, we use the Expert Advisor Studio. It is a strategy builder that we use to create Forex robots without programming skills. And thousands of our students are using it successfully. I have selected to use the cryptocurrencies because I wanted to show you that it is possible to do it not just for the Forex pairs. Before I show you how to create Forex EA without programming. I have to say that the most important first step is the Historical data. And you need to have reliable data before doing anything with Forex robots.

We have a great FREE solution on our website that is called Forex Historical Data App. You can use this app or you can import the Historical data from your MetaTrader platform using the data from your broker. If you go to data import , you will see the two scripts that you can use for MT4 and MT5. For this example, I will trade with the Bitcoin, the Dash, the Ethereum, and the Litecoin.

And now, if I go to the generator, I will have as a history data, data source, I have Pepperstone And if I choose the drop-down menu, I have the Bitcoin, the Dash, the Ethereum and the Litecoin. Forex robot is every strategy that is automated properly in order to open and close trades according to predefined rules.

The strategy builders allow us to create Forex EA without programming as Forex robots without mistakes in the code. And this is one of the most common problems if you code the Forex robot by yourself or you hire a developer. The gener ator is an automated process based on the history data we have imported in the strategy builder, which will generate strategies for us. And we can, after that, export each one of these strategies as a Forex robot.

And place them on the trading platform, and they will trade automatically. It will put the profitable strategies into a collection. Now, with the collection, we have many filters that we can add. And you will see just the filtered strategies. After that, you can analyze any of the Forex Robots in the Strategy Editor. The nice thing here is that if you have already some strategy, some existing strategy if you found any Forex robot over the internet, someone shares a video, and so on, you can immediately see if this Forex robot is working profitably or not.

This is very important because this saves us so much time. Let me just quickly show you what I mean. This is the time frame on H1 hour. You will see here I have the history data from of June until today. I can add a Stop Loss and a Take Profit if I use them in my trading strategy. In other words, you add the entry and the exit conditions. You will see here is selected long entry. This means that we put entry conditions for buy:. For every indicator we can select different parameters — MA falls, MA risses, the bar opens above the MA, etc.

If the bar opens above the moving average, it means it was below the moving average. And it will open above it. It means there is a cross of the moving average. And if I click on accept, I will be able to see what the result of this Forex robot is just using one indicator. Obviously it will be a disaster.

Even I put more indicators, randomly chosen indicators. I click on accept I see this strategy is still losing. And this is very important. Because if you have any strategy using indicators usually what people do, they put this strategy on a demo account.

They test it for one month, two months until they realize the Forex robot is losing, and they start changing parameters. So, for example, they try with 15, and they work with They look in YouTube people trying with different parameters for the indicators, and they change it, and change it and never actually having any profits or some good trade, some bad trade and they leave frustrated.

So even if you know how to create a trading robot in MT4 ot MT5 but you do not have the right strategy, you would be still losing.

This means that I can optimize strategy inputs before creating a Forex EA. And this means that the strategy builder will find better parameters for these indicators. We have Multi-Market.

So here we can test if this Forex robot is working on the other markets like the Bitcoin, the Ethereum, and the Litecoin. This is a little bit advanced. And I have a couple of courses actually about algorithmic trading and how you need to use precisely the EA Studio. But here I want to show you a brief presentation. So you will have an idea at the end of the article what is algorithmic trading, what are the strategy builders, and how to create Forex Robot using them.

One more time here, we have many tests for each strategy. And the last thing on the menu here is the portfolio.

Something that is not available with the other strategy builders. Here you can trade many strategies in one Forex robot. Many strategies you can put it on the Meta Trader and they will trade for you automatically. If I go to the generator and this strategy that I had it, I will remove it from the collection. I will go back to the generator, and I will show you how I am using the generator to generate strategies for me.

So for example, I will choose Pepperstone Bitcoin H1. This is on the H1 chart. And I will go to strategy properties. Here are the entry lots that we want to enter. I will need to write 10, pips and the point, just before the last two. And I will give it a little bit bigger range. But to provide it with a huge range to find more strategies and robust Forex robots.

Now, the generator settings are where we choose the working minutes. How long time the generator will generate strategies for us? I set the generator approximately hours simply at the end of the working day I set it working. Only the generator is working while I am sleeping.

I will leave it, for example, to minutes. And I will select Search best-this is the criteria that we want to arrange our strategies. The net balance is the most important, which strategy makes the most profit. In sample and Out of sample is a really great tool that simulated Demo testing and you can learn more about it from the guide.

For the purpose of this lecture, I am not going to use it at the moment. The strategies fulfill the acceptance criteria — simple words the Forex Robot to have predefined limitations. We can add many things to the acceptance criteria. I like to use the most Profit Factor. It is calculated when we devide all the profits by all the losses. I always want to trade with strategies that have Profit facotr bigger than 1. I will leave it this way. You can add some more criteria if you want the strategy and what this means?

If I go back to the generator that it will show only strategies that fulfill the acceptance criteria. For a few seconds I have many strategies calculated and already have some strategy into my collection as a Forex robot. The longer I run the Generator the more strategies I will have and I will have a better chance to find a very nice and profitable Forex robot. Of course, you can add different filters, profit factor as well I prefer to stay at 1. I prefer to remain at 1.

The other filter that I usually use here is a maximum of consecutive losses. For example, if I place 20, I will have more strategies into the collection 7 out of the 70, if I place ten they will call lower, and if I place 15 you will see that I have only 7, and if I put 5, for example, only one strategy will pass.

I will leave this generator working for the whole night, and tomorrow, I will see the final results. But if I decide to use any of the strategies I can easily export them as Forex robots for MT4 or MT5. And I will leave it for minutes to work and to generate strategies for me.

The Expert Advisor Studio just generated more than 11, strategies for about 5 minutes and I have 96 into the collection. Just what I was showing you as an example.

But here is an exit condition, and if I click over the chart, you can see the indicators.

How To Create a MetaTrader 4 Trading Robot,How to create a trading robot?

22/4/ · Another solution to create a trading robot is using a software. There are software programs that we use to automate the strategies without programming skills. This is indeed a Do not worry, my name is Petko Aleksandrov, the Chief trader at EA Forex Academy, and in this article, I will share with you what is the easiest way to create Forex EA without programming. Points to follow to create your robot. Create an algorithm with trading rules; Steps to creating your first robots with EA builder; Backtest the strategy; Optimize the strategy; Save your forex ... read more

If the Expert Advisor is designed to work at open prices, StartIndex returns 1 and the analysis starts with the last formed bar. This is how I personally succeed to automate the strategies I use. Attached files Download ZIP. Your email address will not be published. So what are the strategy builders? To test the efficiency of our module, let's generate an Expert Advisor based on it in the MQL5 Wizard and run it on the chart. This is how the buy signal is checked it's all the same with the sell signal :.

For every indicator we can select different parameters — MA falls, MA risses, the bar opens how to create forex trading robot the MA, etc. All other parameters have also been added by the MQL5 Wizard while generating the EA based on the selected money management module and position maintenance module Trailing Stop. Do you want to create Forex EA without programming? And I will go to strategy properties. But the important thing here is to make it on a separate browser. Thank you for the great article.

Categories: