NavigationUser loginWho's new
Who's onlineThere are currently 1 user and 27 guests online.
Online users:
|
First session using Expert Advisors!Hi folks, Your speaker today Coders’ Guru, One of Mars planet residents who have been decided to travel to the Earth when I heard about the great advantages of using MetaTrader Expert Advisors. Unbelievable story huh? Ok this is a real one: It was a full of traffic day, the trend going the expected direction and the pips fall down one after one from the sky. I have to stay in front of my terminal these hours to fill my pocket to the maximum gain I could make. Suddenly, I found my little daughter crossing my room and shouting at me “Father, you promised me to teach me today how to set the chess board”. I promised here today? I don’t remember! My wife entered the room and said to my daughter “don’t bother your father” I smiled “Your father always forgets his promises” I shocked “didn’t you promise me to go shopping together today?” I promised here today? I don’t remember! Well, I have to use an expert advisor to automate my trade and to safe my family! What is the expert advisor?The expert advisor is a piece of code (Some of instructions you give to MetaTrader) written in a specific programming language called MetaQuotes Programming Language Version 4 (abbreviated to MQL4) compiled to a program which can stay in front of the terminal instead of you and automates your trades. It can analyze the chart as any indicator do plus it can at specific conditions to open, modify and close the trading orders. The expert advisor can do anything you can do except one only thing, it can't do a mistake! Our task today is talking to the new comers to MetaTrader who want to know how to use the expert advisors in MetaTrader. Expert advisors format:Logically, to use the expert advisor you have to have it. There are two formats of expert advisors you maybe have: .mq4 format:If you have the expert advisor in xxx.mq4 format (where the xxx is the expert advisor name followed by dot then the mq4 extension) that means you have the source code of the expert advisor. Source code means you have the expert advisor as a piece of code that written in MQL4. You can open this file in any text editor and read it but you can't use it in MetaTrader yet. Why? That's because, MetaTrader can't load this kind of expert advisors and requires an extra step before loading it. It requires converting this expert advisor to another format it understands, it the .ex4 format. Converting .mq4 to .ex4:MetaTrader can load only the expert advisors which have the .ex4 extension. The ex4 files are the executable version of the mq4. (Executable means they are not in text format anymore but they are in binary format). To convert the mq4 to ex4 you have to do the following:
.ex4 format:This is the executable version of the expert advisor. It's ready to use expert advisor but unfortunately you can not open it in the text editor to view the source code (because it’s in binary format not text format like the mq4 files). Wait! You can't load the expert advisor to MetaTrader yet. MetaTrader require extra step before loading the expert advisor (which I consider it a shortage in this great program). You have to copy the .ex4 file to the /experts folder. You will find the /experts folder is in the installing folder of MetaTrader. If you not sure where is this folder just right click on the MetaTrader icon and select Properties from the context menu then click Find Target button (Figure 5). Congratulations! You can load the expert advisor to MetaTrader now and only now. Loading an expert advisor!You have the .ex4 version of the expert advisor and the expert advisor is located at /experts folder. Well, you are ready now to use the expert advisor. You will find the name of the expert advisor in the MetaTrader Navigator window (Figure 6). As you can see in figure 6, the Navigator window is divided to tree of lists; the list which we interest in is Expert Advisors list. In this list you will find all the expert advisors that in your /experts folder and of course which are already compiled to .ex4 format. Note: If you don't see the Navigator window in your terminal or you closed it, you can bring it back by clicking the Navigator button in the MetaTrader toolbar (Figure 7), clicking View menu and choose Navigator or simply hit CTRL+N hotkeys. To load the expert advisor from the navigator window you can do one of two things:
When you load the expert advisor to the chart you will prompt with the expert advisor input windows (Figure 8). In this window you can input the required data to the expert advisor, for example: Take Profit value, Stop Loss value and Lots value. Note: You will get the details of all the inputs of every expert advisor from the creator of the expert advisor or from the forum you downloaded the expert advisor from. You can change the inputs of the expert advisor or you can leave the default values you see in the input window. After setting the inputs of the expert advisor you have to click OK. If you are a lucky person you will see the name of the expert advisor on the right upper corner of the chart with a fascinating smile beside it (Figure 9). If you didn't find this smile icon that means the expert advisor is not enabled! Enabling the expert advisor:You have to tell MetaTrader to use expert advisor to automate your trade, you have to enable the expert advisor. From the toolbar of the MetaTrader you will find Expert Advisors check button (Figure 10). Check button means when you click it enables the expert advisors and goes to pressed figure and when you click it again it disables the expert advisor and goes to un-pressed figure (Figure 11). Note: When you disable the expert advisor the smile icon goes to "x" icon (Figure 12). |