Today, I will tell you more about MetaTrader Expert Advisor, what are they actually, and how to use them in algorithmic trading.
Are you looking for a free MetaTrader Expert Advisor to download? Scroll to the bottom of the page and learn more about how to get a free Expert Advisor for MT4 and MT5.
MetaTrader Expert Advisor is something quite popular among traders. Many beginner traders think that Expert Advisor is actually a human or an expert that will guide you and help you while trading. Well, that’s not true.
Expert Advisor is actually a programming code that we use to trade automatically. In other words, this is a trading robot.
Everyone knows what is a trading robot I guess but the Expert Advisor, as a phrase, is the official name, or let’s say robot is the slang word. When we say Expert Advisor, it actually means a trading robot. So that’s a code or automated strategy that we use for trading.
So if we have a strategy and we want to apply it on the Forex market, on the cryptocurrency market, on even the stocks market, we can use robots.
But do you know why traders use Expert Advisors? Because this way we avoid the emotions. We don’t manually click and buy with the computer mouse. I don’t execute positions manually on the Forex market for a few years now. I use only MetaTrader Expert Advisors. And here comes the next question about Expert Advisors.
What is MetaTrader?
MetaTrader is the most popular trading platform which is free and most brokers offer it. So if you want to do algorithmic trading, then you better look for brokers that offer the MetaTrader platform. MetaTrader is a third-party company product, developed by MetaQuotes, which offers a trading platform to the brokers.
So MetaQuotes actually sell the platform to the brokers and then the brokers offer it for free to us, the clients. It’s just the broker who pays to MetaQuotes. And it’s quite expensive, last year when I was at the Expo in Cyprus, the Forex Expo, I think the price for MetaTrader was was about $75,000 a year.
So this could be one sign of a reliable broker. If they offer MetaTrader, it means they have $75,000 a year to pay to MetaQuotes company. So this is not just a group of people or someone who just established a broker and they don’t have $75,000 for MetaTrader.
What is MetaTrader Expert Advisor?
But why do I say MetaTrader Expert Advisor? Because the Expert Advisors and the robots are created for this trading platform. MetaTrader is the most popular trading platform in the world. Moreover, it is the most reliable platform for algorithmic trading with Expert Advisors.
And by the time you’re reading this lecture, it could be that some other platforms or web-based platforms can actually offer algorithmic trading, but I’m pretty sure that MetaTrader will last for probably another decade on the market because already many of the brokers use it.
The MetaTrader variations
We have 2 major variations of the MetaTrader platform. One is MetaTrader 4, or MT4, and the other is MetaTrader 5, or MT5. In the last several years, the guys behind MetaTrader are pushing the clients to MT5. Even from the official website at mql5.com, you cannot download MT4 anymore. But most of the traders like me still use MetaTrader 4. And I will tell you why.
Because there are bugs with MT5 that are still there. Moreover, when it comes to algorithmic trading and MetaTrader Expert Advisors, it is so much more comfortable to use MetaTrader 4 compared to MetaTrader 5.
Compiling the Expert Advisors in MT4 & MT5
First, when we use many Expert Advisors in MetaTrader 4, just like what I show in my courses, there is the Refresh trick. When you go to the Navigator and you just right-click and refresh, you can compile all the Expert Advisors.
And what this means for beginners? When we have the code for the Expert Advisor, we need to compile it to a ready EX4 file which is the ready-to-use file by the MetaTrader platform.
And if you have like 50 Expert Advisors, with MetaTrader 5 you need to click on each one and compile from the MetaEditor, which is the place from where developers code the Expert Advisors.
Now if you close MetaTrader 5 and reopen it, they will be compiled. However, I’m not that sure if that method is reliable.
So I definitely use MetaTrader 4 when I trade with many Expert Advisors because I just right-click with the mouse and compile all the EAs very quickly.
Limitations when trading with Expert Advisor in MT5
The second concern when we use MetaTrader 5 is that we cannot choose the direction for the robots. And with many semi-automated systems, you might want to choose a direction for the robot, Only Long or Only Short. In other words, you can set it only to buy or only to sell.
If you see a clear uptrend with any asset and you just want to buy but you want to use a robot for that or MetaTrader Expert Advisor, with MetaTrader 4 you can set it to only long. Which means it will only buy. Or if you see the market going down, you want to sell, then you can use the Robot with only short mode. Which means that it will only sell. With MetaTrader 5 Expert Advisors, that’s not possible.
And lastly, it depends on the broker you select to use. Some brokers offer MetaTrader 4, others offer MetaTrader 5 and the big brokers offer both MT 4 and MT5. So you can have an account in both of them if you wish.
Courses with 99 MetaTrader Expert Advisors
Now keep in mind that when you trade with Expert Advisors and if you want to trade with many, you can go maximum of 99 charts with MetaTrader. Meaning that you can trade 99 MetaTrader Expert Advisors simultaneously and that’s the maximum.
That’s why I have 3 courses where I include 99 MetaTrader Expert Advisors. This is the Automated Forex Trading course, the Bitcoin Algorithmic Trading course, and the Ethereum Trading course where I include 99 Expert Advisors monthly. So everyone who enrolls in the course can actually test the 99 Expert Advisors. And to make the courses really useful, I have decided to update them every month with new 99 EAs. Basically, these are the EAs that I use for my personal trading.
My system for trading with Expert Advisors on MetaTrader
And what’s the system that I follow when I trade with MetaTrader Expert Advisors? I trade many EAs on a Demo account. And then for my Live account, I put the top performers.
So I test, for example, 99 Expert Advisors on 3 different currency pairs, let’s say EURUSD, EURJPY, and USDJPY. This way I have equal exposure. Then I follow the results through statistical websites like TradingView, and finally, I put in my Live account only the top-performing MetaTrader Expert Advisors. This way, I always trade the Expert Advisors or the robots that are currently profiting on the market. That’s the system I’ve been using for the last 3-4 years, and it works pretty well for me.
If you want to learn more about this system, check out the above-mentioned courses, where I show how I do everything step by step.
How to create Expert Advisors for MT4 & MT5
I want to say that I’m not a developer. I don’t know how to code Expert Advisors and I don’t need to. Why? Because in the 21st century there are strategy builders that create EAs automatically for us. These are software or programs which allow us to program or automate the strategies without coding experience.
Of course, most of these strategy builders are costly because they save a lot of time. They are professional tools for traders. I use 2 of them – one is EA Studio and the other one is FSB Pro. We have integrated them on the website for everyone who wants to try. There are 15 days free trial which you can use to export, generate, and automate as many Expert Advisors as you wish without limitation.
And actually, you could use these programs without a license. You just need a license when you are exporting the strategies as Expert Advisors for MetaTrader. But that’s the easiest way to go. Anyway if you want to have your own Expert Advisor you need to learn to code or you need to hire a developer. Both will be costly as well. And because I don’t want to do both of them, I use the strategy builders.
In the Academy, we use the most EA Studio, which is a fast and reliable online software for creating and testing MetaTrader Expert Advisors. With EA Studio I can create my trading strategy and export it with one click as an Expert Advisor for MT4 or MT5.
More, there is the option to generate strategies, which is pretty cool. So I set predefined rules and then I just generate the strategies.
The software will show me the trading rules, indicators, Stop Loss, Take Profit, and everything that predefines a strategy to open and close trades automatically. So I don’t need to do anything manually.
Should you buy a MetaTrader Expert Advisor?
MetaTrader Expert Advisors are very popular on the market, and there are hundreds of websites from where you can buy an Expert Advisor. I personally have tried many and I can tell you that 99% of them are really crap. It is super hard to find a profitable strategy because the person that has created it has to take care of it, has to update it, has to share results so you will know it’s reliable.
Look for reviews for the MetaTrader Expert Advisor that you are planning to buy before you actually buy it. As well, be sure that the money-back guarantee features among these websites. We offer it as well on our website so anyone who is not happy with the results of the MetaTrader Expert Advisors, can always refund it. That’s the right way to go nowadays and not just to spend money for something and then you cannot get your money back.
Everyone has different expectations, everyone is looking for different things. So make sure to read reviews before you buy any MetaTrader Expert Advisor, this way you will know what the others experienced and if that meets your expectations or not.
Backtesting MetaTrader Expert Advisor robustness
MetaTrader Expert Advisor is the way to trade automatically and avoid emotions while trading. Now, I will show you how to test the robustness of every МetaTrader Expert Advisor. This is very important, especially when you buy an Еxpert Аdvisor from the market. People sell Expert Advisors with over-optimized equity Lines. I will tell you what this means in the next rows, and I will show you how to backtest an Expert Advisor for MT4 or MT5.
Basically, when we are doing a backtest, we see the result for a trading strategy in the past for some period of time. We are testing this strategy for some period of time and we see a backtest.
Now, if you see a very nice backtest, this doesn’t mean that the strategy will continue profitably in the future. So we want to find the strategies that are robust, that show backtests with nice results but with chances to continue trading profitably in the future. I will show you how to avoid over-optimization with a MetaTrader Expert Advisor later in this article.
Now, let me put a MetaTrader Expert Advisor back on the chart. I will drag it over the chart in MetaTrader, and I will click on OK and here it is. So I have the MetaTrader Expert Advisor over the chart and I want to backtest it. I will right-click and I will go to Expert Advisors and I will go to Strategy Tester.
You will see the window that pops up below. And what we have here, we have this MetaTrader Expert Advisor, this currency pair. As a Model, I will use Open prices only because the Expert Advisors that I’m using and those that I will include in the Algorithmic Trading Strategies + USDCAD EAs course, as we said, are using the opening of the bar.
What means Open prices only when backtesting MetaTrader Expert Advisor?
- the Backtester will execute the trades on the opening of each bar
- the closing price of the previous bar is very close but not the same
- this method is most reliable when using EA Studio strategy builder
- the brokers do not provide tick data, that is why it is good to use Open prices
This is the moment when they check if the entry conditions are there.
And what we will do in this example is to use the data from the 1st of January last year until the 4th of March this year. So we’ll be testing it for one year and three months. Alright? It is on M15. We will use the current spread that we have at the market for the moment.
So I will click on Start and you will see how quick was the MetaTrader backtest. This is because the code of the MetaTrader Experts Advisor is really good, nothing complicated or nothing unnecessary there. That’s why it works extremely fast with the MetaTrader platform.
You can see all opened and closed trades for any period.
And if I go to the results you will see all trades that were open and closed. You can see this is the 2nd day, in the first, there was a sale, then we have another sale, sale. And here is the result and the balance and you can see all the trades that were opened with this strategy for the last 1 year and 3 months.
Actually 2 months, because we are at the beginning of March. So 1 year and 2 months, we can say, it’s a 14 month period. If I go to the graph, you will see we have this normal graph, we can say, for a MetaTrader Expert Advisor.
It goes up and down. There are some drawdowns but not huge ones. There is some stagnation of course. But finally, we are on a profit.
And now when we are talking about over optimization, this is what exactly we don’t want to see. One straight line which will show you only profit, profit, profit, profit, and nearly without any losses. And these are the Expert Advisors we want to avoid, where we have the perfect parameters for the strategy to show you this great backtest.
What stagnation of the equity line means with a MetaTrader Expert Advisor?
I want to see in my trading, Expert Advisors that are having this curve line where we have up and down, up and down, but it goes up. Now I have selected here just a random, normal Metatrader Expert Advisor for the USDCAD where the equity line goals in a profit, goes down. You see there is a huge period here in stagnation.
What the stagnation means is for a long time the price didn’t succeed to reach a better profit than the previous point. So, for example, here it reached this point and you can see after that for a long time until here it did not make a better profit than this moment over here. So this whole thing is called stagnation.
But I just took this MetaTrader Expert Advisor really randomly to show you how you can check the robustness with the Expert Advisor. So here are the settings of this Expert Advisor, and finally, the result, what we have is 11,105. This is starting with $10,000 of account.
You see if I go to export properties it is testing with $10,000 of account. Here are the inputs. Now one of the oldest methods, I can say, in testing robustness with Expert Advisors is to change some of the values and see if the result will stay similar or not.
What changing the parameters will do to the MetaTrader Expert Advisor.
For example, here we have a Stop Loss of 94 pips and Take Profit of 55 pips. Now let’s make this Stop Loss 4 pips lower.
I will do it 90 and I will click on OK. Alright? Now I will click on Start again and I will see what the result is.
You see the line is pretty much the same. What we have actually is a better result. You see I have 11,201. Alright? So this means that with this Stop Loss the strategy was even a little bit better.
But what it means actually for me is that the strategy is not over-optimized. Changing a parameter didn’t change crucially the strategy. Now let’s change the Take Profit as well.
I will do it Take Profit of 60 instead of 55. I will click on OK and I will do the backtest again. You see the graph, it’s pretty much similar. Here you can notice that the stagnation is a little bit bigger I think, a little bit more of a drawdown here.
What is an over-optimized strategy?
- Metatrader Expert Advisor that was fit to the past Historical data
- The parameters of the indicators are optimized for the tested period
- There is a huge chance that this strategy will fail in the future
- Robustness testing is a must to avoid trading with over-optimized strategies
And the results, what we have is 10,895. So now it is getting actually worse when I changed this parameter. But one more time it didn’t change crucially, I’m having very same equity line.
And what would be an over-optimized strategy is when we change some of the parameters and we see a totally different result. And I will show you such a strategy right now. Let me remove this one from the chart.
Right-click, Expert Advisors, I go to Remove and then I will drop another strategy and the Meta Trader. I will go to File open, Data folder, MQL4 and I will go to Experts and let me delete this one so I don’t make a mistake which one I’m backtesting. Here it is, I will double-click on it and I will compile it.
One more time you can compile it from the folder on the Navigator from right over here. If I just click right mouse and refresh, this will still compile the Metatrader Expert Advisor. I will drop it over the chart and here are the parameters
for this strategy.
I will click on OK and you see it is attached on the chart. Now I can change the Expert Advisor from here but actually, I deleted the old one, so I have only this one. Anyway, if you do it for the first time, one more time you go to Expert Advisors and you click on Strategy Tester and it will be the one that is attached on the chart.
So you see if I click on Start, I will have the equity line which is pretty nice. Actually even better than the previous strategy. But if I go to Settings and I go to Expert properties and I go to Inputs, let’s say I will change here some of the parameters of the indicators.
For example, RVI is 40. I will change it to 45. Actually, let me see first what the result was exactly with the backtest. So the graph is good, the result is 11,519. Alright? Let me write it down on my next screen, 11,519.
I will go to Settings and I will change some of the parameters, for example, RVI, I will change it to 35 and I will click on OK and I will perform the backtest. I will go to the graph and you can see what a different graph I have. Still positive, what we have as a result is here, it’s 10,372.
The Backtest of a MetaTrader Expert Advisor.
So you see the difference, it was 11,519 now it’s 10,372. Let me change some other parameters. So here it was 40, let’s increase it, let’s make it 45 instead of 5 lower.
I will go to 5 higher and I will click on OK, I will click on Start and I will go to the results graph. Now you can see what I’m talking about. I see a negative equity line. Just a change in one of the parameters and what we have as a balance is 9,462.
So this shows me that this strategy was over-optimized. These properties that I had, exactly with the 40, exactly the Stop Loss and Take Profit exactly with the other parameters, it was over-optimized. So when I click on Start and I do the backtest I see a very nice equity line.
But this is because these parameters for these indicators were fit to this testing period. And we cannot depend that this strategy will perform well in the future. Maybe it will. There is a chance that it will, but most probably it will fail.
The indicators were set to show a good equity line with the MetaTrader Expert Advisor.
Because the indicators, the parameters’ indicators were set in such a way so it will show me a good equity line during this test period with these parameters. Exactly with these parameters and one more time let me change something else to demonstrate it once again. For example, I will change the average true range from 47 to 50. Very close number.
I will click on OK, I will click on start and I will go to the graph. You can see it’s losing again. So this is one of the best ways in Meta Trader that you can check if your Expert Advisor is over-optimized, no matter whether you buy it from the market, you take it from somewhere, it is always good to perform a few backtests with different parameters to make sure that you are not going to trade with over-optimized strategy.
With a strategy that was fit to this trading period that you’re testing, or it could be actually for the last 10 years, or even for the 20 years it doesn’t matter, it could be any period. I just selected the last one here from 2018 till now. Alright, guys? This is how you can check if your strategy was over-optimized with Meta Trader.
Just change in the Expert properties some parameters. Not too much, as you saw just with 2, 3 points or 5 points up and down and if you see a dramatic change in the equity line this will show you that probably this strategy is over-optimized.
Conclusion about MetaTrader Expert Advisors
So this is the most important information you need to know about MetaTrader Expert Advisors. These are automated trading robots for one of the most popular trading platforms, MT4 and MT5. And most of the regulated brokers offer these platforms. Of course, don’t forget to use a regulated broker when you start trading, this is very important so you won’t lose your money.
Thank you very much for reading this lecture. If you enjoyed it take a look at the Algorithmic trading strategies Top 10 USDCAD EAs course where we share more tips and tricks about trading with MetaTrader Expert Advisors.
If you have any question, feel free to drop them in our Forum and I will make sure to answer as soon as possible. Also, in the Forum you will meet fellow traders which will share their experience with you. This a great place where traders exchange ideas, test MetaTrader Expert Advisors together, and benefit from each other’s experience. The Forum is free to access and everyone with a registration on our website can access it, and write questions. Everybody is welcome to join!
Enter your email address below to receive a free MT4 & MT5 automated trading robot.