Magic number Forex – The Expert Advisors

Magic number Forex – The Expert Advisors


Dear traders, in this lecture I will talk about the Expert Advisors themselves. These are the automated strategies. So if you have a normal strategy, a manual strategy that you learn from somewhere, you saw some video, you read it in the book and you applying it daily. But with the time you will notice that you are missing so many entries. All right? Because obviously we are human beings. We cannot sit in front of the computer 24 hours from Monday to Friday. And this where the Expert Advisors can very useful because they trade all the time. Simply these are codes that we attach to the Meta Trader platform. They are structured in a file and we attach this file to the Meta Trader platform. Just what I have already shown and they execute the trades automatically and we don’t need to be in front of the computer and we don’t need to do basically anything. Once we place the Expert Advisors over the chart. All right? Now if you look again on my chart I will right click on one of the Expert Advisors and I will go to modify. This is from where you are able to see the code of this Expert Advisor and it opens in the Meta Editor. Now if I scroll down you will see that we have really long code for each Expert Advisor and if I go down to the end, you will see it’s about 7000. In this case it is 6 757 or 56 rolls to the end. It’s really, really huge code. It is much longer than the Expert Advisors we have created with EA Studio. However this is for couple of reasons. Here we have the following on the higher time frames. We have many more options in the settings of the Expert Advisor. We have the possibility to add to the position, to reduce from the position, to reverse the position if we decide. Really, really many more things. And if I go to the top, you will see where we have the indicators parometers, and I can change the Stop Loss and Take Profit after that. I will need to click on Compile and it will change the Expert Advisor inside the Meta Trader. And below you can see I have the other indicators from this Expert Advisor and pretty much this is what I know from the Expert Advisors code. What is below? I’m not really a developer and I don’t know what all these things mean. Of course, with the years I have learned some things, but I’m not touching anything of the code and I don’t suggest it to do that. If you are not an advanced developer. And all of that came with the FSB Pro because this is what I have used to create these Expert Advisors. So I didn’t hire any developer to do that for me. It would be very time consuming and it will actually cost me a lot of money. Actually I have been through this process already where I was hiring developers to program or to automate strategy. For me it was really time consuming. It was very expensive. These guys take a lot of money for that and it’s really hard, because they need to have an idea about Forex or about Trading. And it was taking nearly 1 month to develop the whole Expert Advisor. Obviously after that there were mistakes. I had to give them Expert Advisor back. So I was testing it then giving it back. And then again and again, and sometimes it was taking couple of months for one single Expert Advisor. Very expensive, time consuming and this is a hard thing that I’ve been through. However when the Strategy Builders came up, it is so much easier for me and for many traders the algorithmic trading became much more easier. And we do it much faster. All right? So this is from where we have access to the code. From here you can compile it and this is very same thing just what I have showed to you. If you right click over Expert Advisors and click on Refresh. Still this forces Meta Trader to compile the Expert Advisors. The 2nd thing I wanted to show you is how you can change any of the parometers from trading chart and it’s better. So once you have any of the Expert Advisors, placed over the Meta Trader. You can right click, go to Expert Advisors and go to Properties. This is from where you have the inputs and this is from where you can change any of the inputs much faster, much easier. No need to go into the code. So here with these Expert Advisors what we have. We have the amount for a new position, how many lots you want to trade with. What is the maximum position amount. As I said already you can add to the position on the next same entry signal. Below is the amount to add and then you have amount to close on reduction. But for these strategies I have selected to reverse. So when you have an opposite signal, they will close the existing trade and they will reverse the position. Below you have Stop Loss, Take Profit, Break Even. We don’t have it for this strategy and then we have below the parometers for the indicators and the magic numbers. You can write as well a log file and if you just click on True, you will be able to write a log file if you want for your Expert Advisors. And pretty much this is about the Expert Advisors. Really nothing complicated. And one more useful thing. And the magic numbers is not only that we follow their performance after that, but if you disconnect your computer from Internet, if you restart it, if anything happens and you reopen it after that and you have already open trade, just as I have, the Expert Advisors will recognize the open trade with the magic number. OK? So they will not open a new trade. So if I restart my computer and I reopen the Meta Trader, these two Expert Advisors will recognize the open trades. They will not open another trade until these two are opened. So this is very very useful, because it happens that sometimes we disconnect from Internet, or we disconnect from the server of the broker. All right? And the last thing I wanted to mention over here is that if I go one more time to the place where I have placed the Expert Advisors. This is in Open Data Folder and I will go to MQL4 and I will go to Experts and as you can see we have two types of files. One is the EX4 File and the other one is the MQL4 Source File. This is what you will receive from me in the course the source files. This is from where you can access the code of the Expert Advisor. Now when we click Expert Advisors, right mouse and we go to Refresh, we compile the Expert Advisors. And this is how we got to the EX4 File. So these are the compiled Expert Advisors. Most of the time when you buy an Expert Advisor from the market, you will receive only these EX4 File. So they don’t provide you really the MQL4 Source File, but I prefer to provide it. If any of you as developer wants to test something, wants to change something, want to learn from the code. You’re very welcome to do it as well. As I said, personally me, I don’t touch anything in the code. OK, guys? So these are the things about the Expert Advisors. And below you have this tab that says Experts, and from here you can see kind of information what we had with the trade when it opened. We have the number of the order. What it did, at what price, Stop Loss, if there is one and so on. OK? So there is some information here about the actions with the Expert Advisors. Not a bad idea to have a look at those sometimes and as well in the journal. So you will see if there are any mistakes with the Expert Advisors. All right? So this is about the Expert Advisors. Let me know if you have any questions. Thank you for watching. Cheers!

Leave a Reply

Your email address will not be published. Required fields are marked *