Forex Expert Advisor and it’s creation is the main purpose of the online trading courses in EA Forex Academy
Forex Expert Advisor selection is the topic of this article, which is part from our course London, New York and Tokyo Algorithmic trading course. It is presenter by Petko Aleksandrov, the Head mentor in the Academy. He has run the reactor in EA Studio which is powerful tool in algorithmic trading to create robust Forex Expert Advisor.
This is a strategy builder that generates Forex Expert Advisor with predefined rules and conditions over the Historical data of the broker where the trade is going to use the Forex Expert Advisor. Also, the mentor has set trading hours according to the London stock exchange. This way each Forex Expert Advisor will trade according to these hours. The trade will be opened after the stock exchange is opened. And they will close automatically before the last bell rings. This way the trader catches the volatility. Enjoy the lecture!
Dear traders, I continue on the next day after
I have run the reactor for the GBPAUD and for the EURGBP. I have chosen these pairs because they are connected the the London Stock exchange, and each Forex expert advisor will trade on those pairs.
You can see here that totally 74 521 strategies were generated with the EURGBP. They were actually above 100 000 and from these 74521, 906 past the validation. So, this is the acceptance criteria where we have said. And from these 906 you can see that 250 passed the validation of Monte Carlo.
Monte Carlo is the robustness test for each Forex Expert Advisor. This way we test the strategy before placing it even on a Demo account. This tool performs different simulations with different spread, historical data, randomize back test starting bar etc, for the Forex Expert Advisor.
And in the collection I see the top 100. There are 250 but I see the top 100.
Let me just click on the first strategy to show you what exactly is the Monte Carlo test, that I have mentioned couple of times. After the strategy is generated it calls automatically to Monte Carlo. And Monte Carlo one more time, this is a simulator which tries to break the strategy. And if I click start you will see that here are the calculated tests, progress and how many of those were validated.
If you remember I have said 20 tests and I wanted 80% of those to be profitable. You can see with this first strategy that all of the tests actually are profitable. And here are the different simulations you can set up.
The first one are the market variations for the Forex Expert Advisor – randomize history data, the randomize spread.
This is very good because the spread normally with the brokers as we said it’s floating. Here one of the simulations is with different spread and with different history data and you can see some more positive, some more negative results, but still profitable results:
If you have execution problems with your broker here as well you can choose to use these ticks and strategy variations. You can test the strategy with different parameters. And when I click on the collection again what I will do? I will filter now these 100 strategies with these filter records over here:
If I select use performance filters you will see here will come another menu from where I can add filters. You see there are many options, let me just go down a little bit.
Here what I do?
For example, if I choose a minimum profit factor and I have one, you will see that 100 of the 100 strategy pass the validation. If I increase it to 1.1 you will see that 72 of these 100 pass the validation. Simply, here with this filter we are limiting the number and by using different filters we will leave the top strategies out of the 100. Now, I see 100 because 100 are into the collection. But you see that only 23 out of the 100 passed the validation from the filters. And if I click this button I will remove all the 77 rest strategies (each one is a potential Forex Expert Advisor, but we need to filter them).
Let me just add another filter. Profit factor is a very good filter. And another good filter that I like to use is the maximum consecutive losses. And now you can see that with 10 maximum consecutive losses still 23 strategies are available. I will reduce 9 and I will go to 8-22. So, they are going down and let’s go to 5. You see only 6 out of the 100 strategies now are left, only these 6 strategies.
This means that these 6 strategies are having better profit factor than 1.3. And they don’t have more than 5 consecutive losses.
What are the consecutive losses in a Forex Expert Advisor?
When having 5 consecutive losses, this means that this Forex Expert Advisor for the whole tested period had no more than 5 losses in a raw. That is a very good statistic!
The other thing here I can add more filters. But what I prefer to do when I have couple of strategies left, is just to look at their profit line. What I see with the first strategy even it makes most profit, is that if there is this huge drawdown over here. And you see the recent days the profit line starts to go down, starts to lose. I will simply remove it from this button over here.
You see this strategy as well is going down in the middle of the period. And then it’s going just sideways, so I will remove it as well. I have 4 more strategies left, you see that the first strategy here as well has this drawdown, I will remove it.
These strategies look really nice but I will choose these two. Because the third one recently as well is losing.
I have these 2 strategies now left into the collection. I will do the very same thing with the other currencies. Because I want to trade totally 12 Forex Expert Advisor. I will choose 2 strategies for each currency. So, you see from 70 000 strategies top 100 were selected then I added more filters. And I have left to with the 2 strategies that passed all the validations and they are having good profit factor and no more than 5 consecutive losses:
When I go to this button over here that says Expert Advisor for MT4. And this one that says Expert Advisor for MT5 with one click I can export these strategies as Forex Expert Advisor. This is the very, very nice thing of EA Studio that with one click it exports the strategy as Expert Advisor.
If I click on it you can see what are:
- the entry conditions;
- the exit conditions;
- the profit;
- the indicator chart.
You can zoom it if you want to see where exactly the trades happened:
Here is the balance chart for the Forex. And here in the beginning actually there is more statistics about the strategy profit per day, count of trades totally, win/loss ratio, sharper ratio etc, for the Forex Expert Advisor.
If I go to Journal I just want to show you that we are within the trading hour. You see the first trade for example opened at 08:45 and it closed at 13:30. Then the next trade was open at 9:30 in the morning and it was closed 12:45. You see that all the trades are within the London trading session. This is what we were looking for.
And let’s now switch to the EURGBP collection.
You can see the strategies are over here with pretty nice profit lines actually. And only 14 strategies passed the validation and the Monte Carlo. This is very nice because from more than 100 000 strategies, only 14 are in our collection. So, it will be easier for me to filter these strategies. And one more thing I wanted to show you in Monte Carlo.
If I click on the strategy Forex Expert Advisor, and I go again to Monte Carlo you will see here on the strategy variations the last one is the randomized indicator parameter. If I remove all of the previous ones and I select randomize indicator parameters, and I click on start the simulator here will try to break the strategy with different indicator parameters. Simply, it will make simulations with different parameters for each of the indicators. This is a very good indication if these strategies were over optimized:
You see I have some of the variations here going sideways, some of the simulations. But I don’t have any losing strategy that is going down.
This normally happens with over optimized strategies when you run this simulation you will see here just a dramatic drop in the results for the Forex Expert Advisor.
It means that the chosen parameters for the indicators were chosen in a best way in order to show a good profit line. But this is not what we are looking for. We are looking for the robust strategies.
Let’s go back to the collection and here are the filters. I will need to select only 2 out of the 14. I will start again with the profit factor. Because it filters the strategies very well, let’s just increase it a little bit. With 1.4 I have 10 out of the 14, let’s increase it one more time. And I will have just 5 left, 5 strategies are into the collection. I will add just one more filter, let’s choose something else.
For example, I can choose maximum stagnation. And see exactly if I choose the maximum stagnation of 30% it will filter out the other strategies. I just saw that they have a little bit more of stagnation.
That’s why I wanted to use the stagnation.
The stagnation is this period for example here, where the profit reached a top and then it just goes down and then up. So the whole period where the Forex Expert Advisor is not making more profit than it reached the current moment it’s called stagnation.
And you see with these 2 filters exactly I have the 2 strategies, I will just export them. And you see that by one click again I export them as Expert Advisors. You see that I even don’t look into each strategies, I don’t click on each parameter to look at the details about the parameters. Because really it’s not necessary to do it.
We have tested this strategy builder EA Studio long, long time. And we saw that we don’t need to touch anything inside the strategy.
The Stop Loss is here, the Take Profit is here for the Forex Expert Advisor:
the parameters are set exactly to show this profit line.
And you will see later on in the London, New York & Tokyo Algorithmic trading course I will show you that when we backtest it on Meta Trader 4 we will see the very same results which is the most important. And since the strategy went through the Monte Carlo and it passed the validation of the acceptance criteria we are all right.
This is for the London market, I have the 4 strategies now downloaded.
And I will continue in the London, New York & Tokyo Algorithmic trading course with the New York and Tokyo markets.
The idea here is that we generate, filter and automate different strategies. And each one becomes a Forex Expert Advisor. We trade them on the specific time of the stock exchanges. This example was for the London hours.
If you decide to create your own strategies and trade with any Forex Expert Advisor, make sure to fir the hours in EA Studio – tools – data horizon. If you generate strategies on different trading hours that will not be according to this trading system.
There are many websites where you can see the exact working hours for the three important stock exchanges. And convert them to your time local zone. More important is to make it exactly as your broker shows on the platform. Sometimes the brokers show different from your local time. Check it before starts generating EAs, anyway you will need to do it all over again.
Another thing is that when you use this system for EA Studio. And after that you generate Forex Expert Advisor for trading 24 hours, make sure to remove the time zones from the settings.
Thank you for reading. If you have any questions, you can always write in our support FORUM.
For more Algorithmic trading courses please visit: https://eatradingacademy.com/courses/algorithmic-trading/