MQL4TUTORIAL.COM

MQL4TUTORIAL.COM

By MQL4TUTORIAL.COMBusinessInvesting
Download on the App Store

MQL4TUTORIAL.COM episodes

  • MQL4 TUTORIAL BASICS – 58 SIMPLE DYNAMIC BUY POSITION SIZE
    In this video we are going to calculate a dynamic position size that is based on the equity, so let’s find out how to do that for buy positions in mql4. To get started please click on a little button here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple dynamic buy position size, click on continue, continue and finish. Now you can delete everything above the on tick function and the two comment lines here. For this simple example, we are going to dynamically calculate the buy position size based on the account equity, this function will return the current equity value for the account, basically, that’s what is left over after you have paid for fees and open positions and I would like to have the position size calculated dynamically so I use the account equity and divided by 100,000. Usually, the result will have a number of digits behind the dot that is too high, so I use normalize double and cut off the calculated value to two digits behind the dot, otherwise, you might see a lot of errors here in the journal and that would be something like wrong position size, so this is a way to prevent that. I would like to open trades only if the account equity is equal or higher than the account balance and my second condition would be if the return value for orders total equals zero. Orders total will return the number of market and pending orders so if the return value is zero that means that we have no open orders and no open positions and if this is the case we will use the order send command for the current symbol on the chart to open a buy trade with the position size that we have calculated here. Finally, we use the comment statement to create a chart output that will tell us the current balance, the equity and the current position size and that’s about it. If this was too fast for you or if you don’t understand what all the code here does maybe you want to watch one of the other videos in this basic video series first or maybe even the premium course on our website might be interesting for you, otherwise, click on the compile button now or press F7 on your keyboard. You shouldn’t get any errors and if this is the case you can click on a little button here or press F4 to go back to Metatrader. And in Metatrader you want to click on view, strategy tester or press control and r, please pick the new file simple dynamic buy position size dot ex4, mark the option for the visual mode here and start your test. Here we are! The current position size is one, so let’s speed up the process a little bit and now you should see that the value is changing based on the equity, we see the position size is going down, that’s also what the equity does here, so our little expert advisor is working as expected and in this little video you have learned how to dynamically calculate the position size based on the equity and you have coded it yourself with a few lines of mql4 code.
    5 min
  • MQL4 TUTORIAL BASICS – 57 SETUP A METAQUOTES DEMO ACCOUNT IN METATRADER
    In this video, we want to find out how to create one of these MetaQuotes demo accounts, these are original demo accounts from MetaQuotes, that is the provider of Metatrader 4, so let’s find out how to create such an account right inside of Metatrader! To do that please right-click on accounts and select open an account, now you should see a lot of entries in my case for RoboForex because that is the broker that I use for my other accounts but here we can add one so let’s type in MetaQuotes and when you click on scan you should see this entry, MetaQuotes demo that is provided by the MetaQuotes Software Corporation so let’s select this one and click on continue. Here we can pick one of three entries, the first one would be to connect to an existing account, the second one is the new demo account, that’s actually what we want and the third one would be a new real account. To create something like this you would need additional authentication. For example, I had to send pictures of my passport and a few account statements but in this video, we just need a demo account so let’s click on continue. Here I have to fill in my credentials, actually, I also have to agree to subscribe to the newsletter, this is little strange… I usually pick one hundred thousand dollars and a big leverage. In Metatrader 4 the highest leverage now is 1 to 100, for German accounts, you could only pick something like this. Now let’s click on continue and here are my credentials. In Metatrader 5 I would get an additional link where I can copy the credentials and paste them into notepad or word. For Metatrader 4 please create a screenshot or write them down, so let’s click on finish and here is my new account. I can now click on log in to trade account and my password is already available, let’s mark the option for save account information here and click on log in. I want to find out if my expert advisor will run with this kind of account, so let’s pick one of the expert advisors here, mark the visual mode and click on start. In my case, it starts to run right away but when I pick another currency pair it might not do anything, it says waiting for update. In this case, you can click on tools, history center, pick the currency pair you need, mark one minute and here you would be able to import historical data, unfortunately, I don’t have any downloads for this currency pair so let’s open the webpage histdata dot com, click on download free forex data, I want forex data for one minute, this is the currency pair I need and I would like to download the whole year 2018, so let’s do that. This is the file that contains all the data we need so let’s copy that, paste it here, now I want to open the file and here is my historical data so let’s close everything, restart the test and this time it works. In this video, you have learned how to create an original MetaQuotes demo account right inside Metatrader and you have done it yourself within a few minutes.
    6 min
  • MQL4 TUTORIAL BASICS – 56 SIMPLE CLOSE TIMER
    In this video we are going to create an expert advisor that is able to close positions that are not profitable after some time has passed, in our case after an hour so if we have no profit we should see that the position is closed, so let’s find out how to code that with mql4. To get started please click on a little button here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple close timer, click on continue, continue and finish. Now you can delete everything above the on tick function and let’s also remove the two comment lines here. First, we want to check if we have open positions that is done by using orders total and if the return value is zero we don’t have any open positions and in that case, we are going to open some test positions here. You wouldn’t do that on a real account but we need some positions that we can close and afterwards we want to call the function check close timer that doesn’t exist so far so we need to create it now. It has no return type so we use void and we use a for loop to go through all the open orders we select each order by using order select, let’s get the local time by using time local that will return the local time of a computer, in our case of the strategy tester and it will return a date time variable but I would like to use a structure, you can do that by using mql date time and if you mark it and press F1 you will see that the date type structure contains eight return values and one of those is the hour, that’s what we need so let’s use time to struct for the time that we have calculated here and convert it into a structure because afterwards, we can simply extract the hour from our time structure. For the output, I would like to have a string variable that is readable so I use time to string to convert the local time to create an output that looks like this. Now we want to get the open time for the position that can be done by using the function order open time, let’s create another structure this time it is called my open time struct, once again we use time to struct to convert the order open time that is the date time variable here to a time structure and now we extract the opening hour by getting the hour from the time struct. I would also like to have the opening time converted into a readable string variable that will look like this one and now we can calculate the time difference by simply subtracting the current hour from the opening hour please remember this will only work within one trading day otherwise you would need to check if the date has changed. Let’s use print to create the outputs we need. In the next step, we check if a certain number of hours have passed, in my case, I want to close the position after the first hours over but my second condition is I only want to close it if the order profit is negative, so if the order type equals op sell we would have a sell position in that case we use order close for the current or order ticket and submit the ask price. Otherwise, if the order type equals op buy that would be a buy position and now we would use order close for the current ticket and submit the bid price. Finally, we need to close the if statement, the for loop and the function and that’s about it. Well if this was too fast for you or if you don’t understand what all the code here does maybe you want to watch one of the other videos in the basic video series or maybe even the premium course might be interesting for you. In fact, this was a question that was provided by a premium course member, for now, please click on the compile button or press F7 on your keyboard, you shouldn’t get any errors here and if that is the case you can click on a little button here or press F4 to go back to Metatrader. And in Metatrader you want to click on view, strategy tester or press control and r, please pick the new file simple close timer do...
    7 min
  • MQL4 TUTORIAL BASICS – 55 HOW TO CALCULATE THE WEEKDAY
    In this video, we are going to calculate the current time and the current weekday. This was a question from one of our premium course members so let’s find out how get the current weekday with mql4. To get started please click on the little button here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple date calculation, click on continue, continue and finish. Now you can delete everything above the on tick function and let’s also remove the two command lines here. We start by creating a string variable for the custom time and let’s do that again for the weekday. To get the time we want to call a custom function called get time and to calculate the weekday we want to call a custom function called get weekday. Both functions do not exist so far so we have to code them now. We want to return a string value for the get time function so let’s create a string called time with seconds. And to calculate the value we use time local, this returns a local time of a computer, in our case, it’s not the time of the operating system but the time in the current backtest and we use time underscore date, pipe, time underscore seconds, if you mark that and press F1 you will see that time underscore seconds will give us time values in this format and we use time to string to convert it to a string value and afterwards, we use the return statement to return the calculated time to the main function. Let’s create a second function called get weekday. This time we need to create a variable that can hold a number, we will call it weekday number and to calculate the current weekday number we use the function day of week, this one will return an integer value for each day of the week but to make it more readable we create another string variable called weekday and depending on the return value for day of week we will assign the value Monday if the return value is one, the day Tuesday if the return value is two, and so on. Depending on the country where you live in, you might be wondering why Sunday is equal to zero. In Germany, we would consider Sunday to be day seven but just the way it is, so keep that in mind. Finally, we want to use the return statement to return the calculated weekday to the main function, so let’s add a comment output here in the main function that will output the time is followed by the calculated time and in a new line I want to see the text today is followed by the calculated weekday. That’s about it. If you don’t understand what all the code here does or if this was too fast for you maybe you want to watch one of the other basic videos in this video series or maybe even the premium course on our website might be interesting for you, for now, please click on the compile button. I didn’t get any errors and if this is true for you, you can click on a little button here or press F4 to go back to Metatrader. And in Metatrader, we want to click on view, strategy tester or press control and r, please pick the new file, simple date calculation dot ex4, mark the option for the visual mode here and start a test. Here we are! The expert advisor is running, we have the output the time is followed by the date and below the line today is Thursday. So let’s check that! And indeed January the 18th in 2018 was a Thursday so our little expert advisor is working as expected and in this little video you have learned how to create an expert advisor that is able to calculate the current time, the date and the current day of the week and you have coded it yourself with a few lines of mql4 code.
    6 min
  • MQL4 TUTORIAL BASICS – 54 SIMPLE IFORCE EXPERT ADVISOR
    In this video we are going to create an expert advisor for this oscillator, it’s the force index indicator. Usually, it’s used to confirm trend signals but we are going to create buy and sell signals, so let’s find out how to do that with mql4. To get started please click on the little button here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple iforce ea, click on continue, continue and finish. Now you can delete everything above the on tick function and the two command lines here. We start by creating a string variable for the signal that will also be called signal but we don’t assign any value here because this is going to be calculated now and to do that we use the included iforce function that comes with mql4. We need to pass a few parameters, the first one is for the current chart, the second one is for the current period on that chart, the third parameter here thirteen is what you see when you click on insert, indicators, oscillators, force index. Here we see that the force index oscillator is calculated based on thirteen candles, the method is simple moving average and the results are calculated based on the close price, so let’s click on okay, here is the indicator, let’s right-click into the chart, select template, save template and save it as tester dot tpl because this is the template that is going to be used in the backtest. You can replace the old value and if you don’t see this dotted line here you can go to the force index properties, select levels and add another level here. It’s also possible to change the style and the color but back to our code, you see that we use thirteen candles, mode sma and price underscore close. The iforce value should be calculated for candle zero to calculate the current iforce value but to find out if we have a crossover we want to do it again this time for the last iforce value but this last value here is for candle one and now we can spot a crossover. So if the last iforce value was below zero and the current iforce value is above zero that would mean that the zero line is crossed from below and now we consider that to be a buy signal so we assign the word buy to our signal. Otherwise, when the last iforce value was above zero and the current iforce value is below zero that would mean that the zero line was crossed from above and now we assign the word sell to our signal. So if our signal equals buy and the return value for orders total is zero – that would mean that we have a buy signal and no open position – we use order send to buy ten micro lot. Otherwise, if the signal equals sell and orders total equals zero – that would mean we have a sell signal and no open orders – so now we use order send to sell ten micro lot. Finally, we create a chart output by using the comment statement. This will output the text the current signal is followed by the calculated signal. Okay! That’s pretty much it. If you don’t know what all the code here does or if this was too fast for you maybe you want to watch one of the other videos in this basic video series first or maybe even the premium course on our website might be interesting for you, for now, please click on the compile button or press F7. In my case, I didn’t have any errors and if this is the case for you, you can click on a little button here or press F4 to go back to Metatrader. And in Metatrader, you want to click on view, strategy tester or press control and r, please pick the new file, simple iforce ea dot ex4, mark the option for the visual mode here and start a test. And here is our little expert advisor at work, we should see a crossover in a few seconds, here it is and we have our first buy trade so the ea is working as expected and in this little video you have learned how to create an expert advisor for the force index indicator that is able to create buy and sell signals and actually...
    7 min
  • MQL4 TUTORIAL BASICS – 53 SIMPLE FIBONACCI OBJECT
    In this video we are going to create a simple Fibonacci object on the chart, you see we have several Fibonacci levels here, so let’s find out how to do that with mql4. To get started please click on a little button here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple Fibonacci object, click on continue, continue and finish. Now you can delete everything above the on tick function and the two comment lines here. This video was requested by one of the premium course members and to calculate the Fibonacci object for one hundred candles we first want to find the highest candle, this can be done by using the function ihighest if you mark that and press F1 you will see that it will return the maximum value over a specific number of bars. In our case we do that for the current symbol on the chart and the currently selected period on that chart, we use mode underscore high – all in capital letters – because mode underscore high will give us the high prices for each candle and we want to do that for one hundred candles starting with candle zero. For the lower border of our Fibonacci object, we also want to know the lowest candle, that can be calculated by using ilowest, that’s also for the current symbol on the chart and the currently selected period, but this time we use mode underscore low to get the low prices for one hundred candles starting with candle zero. In the next step, we use object delete to remove an object that is called Fibonacci, when we run the expert advisor for the very first time we don’t have such an object but afterwards we need to use object delete to remove the old object before we draw a new one and to do that we use object create, this function will create an object with a specified name type and some coordinates. The first parameter here is the name of the object, I will call it Fibonacci, this is a string value, the second parameter is the type of the object, we are going to use obj underscore fibo, if you mark that and press F1 you will see that there are lots of other different object types. The next value here is for the main chart, chart zero is the chart with the candles and we are going to draw right into the chart. For oscillators, you could also use a separate window below the candles. The right border will be the current candle, for the upper border we want to use the highest price from the highest candle, we will use candle one hundred for the left border and the lowest price of the lowest of the one hundred candles will be the lower border. Let’s actually calculate a few of those Fibonacci levels. Level one hundred can be calculated by using object get double for the current main chart, we want to get the price for the Fibonacci object, the property is obj prop underscore price – all in capital letters –, let’s look that one up, there are a lot of different properties. Let’s see if we can find some details, here we are! We have price one, price two, price three and so on. We want to get the first price for this object to calculate level one hundred. To calculate level zero we do the same but this time the last parameter is one and level fifty will be calculated by adding the values of level zero and level one hundred and dividing the result by two, so let’s use a comment statement that will output the text followed by the calculated level for each of those three values. Well if this was too fast for you or if you don’t understand what all the code here does maybe you want to watch one of the other videos in this basic video series or maybe even the premium course on our website might be interesting for you, for now, please click on the compile button here or press F7 on your keyboard, that should work without any errors and if that is the case you can click on a little symbol here or press F4 to go back to Metatrader. And in Metatrader, we click on view,
    8 min
  • MQL4 TUTORIAL BASICS – 52 SIMPLE EXTERNAL CANDLE NUMBER
    In this video, we are going to create an expert advisor that is able to calculate a simple moving average based on an external variable for the number of candles. In this case, we are using one hundred candles to calculate the moving average, so let’s find out how to do that with mql4. To get started please click on the little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple external candle number, click on continue, continue and finish. Now you can delete everything above the on tick function and the two comment lines here, we start by creating an external integer value called number of candles. The first value will be one, we will change that later and the modifier extern is used to create something that can be adjusted without the need to change the source code. Inside of the on tick function we start by creating a string variable for the signal, we don’t assign any value here because this is going to be calculated later. To calculate the moving average we use the integrated ima function for the current symbol on the chart and the currently selected period on that chart. We want to calculate it for the number of candles that we will define, this parameter and the last one have the value zero because we don’t want to use any shift values. This one is mode underscore sma – all in capital letters – that stands for simple moving average, we are going to calculate the result based on the close price and if the moving average value is below the current close price that would be a buy signal so we assign the word buy to our signal. Otherwise, if the moving average value is bigger than the current close price that would be a sell signal and now we assign the word sell to our signal. And when the signal is buy and orders total has a return value of zero, or in other words, we have no open orders that’s when we use order send to buy ten micro lot. Otherwise, if the signal equals sell and we have no open orders that’s when we use order send to sell ten micro lot. Finally, we use the comment function to create an output on the chart, it will output the number of candles is, followed by the calculated value for the number of candles. In a new row, we want to see the current signal is followed by the calculated signal and below we also want to output a hint: Please also adjust the number of candles on the chart! And that’s about it. Well if this is too fast for you or if you don’t understand what all the code here does maybe you want to watch one of the other videos in this basic series first or maybe even the premium course on our website might be interesting for you, for now, please click on the compile button or press F7 on your keyboard that should work without any errors and if that is the case you can click on a little button here or press F4 to go back to Metatrader. And in Metatrader we want to pick a chart without any indicators and click on insert, indicators, trend, moving average, we will start with a value of one hundred candles, we use a simple moving average that is based on the close price, so let’s pick a color and click on ok. Here is the sma, now we use a right mouse click, select template, save template and save it as tester dot tpl because this is the template that we are going to see in the next strategy test, so let’s click on save, you can override the old value and now click on view, strategy tester or press control and r, please pick the new file simple external candle number dot ex4, mark the visual mode here and start a test. Here is our little expert advisor at work, this is the moving average that is based on one hundred candles, it matches the number that we see here, so you should see buy and sell signals based on this value here and here we have a sell signal, so our little expert advisor is working. Let’s stop the test here, select expert properties,
    7 min
  • MQL4 TUTORIAL BASICS – 51 HOW TO DO MASS TESTING
    In this video we are going to perform mass testing with a random generated entry, you see that it is producing buy and sell signals on a constant basis, most people think you cannot make a profit with random based entries so let’s find out! Usually, you would like to do this kind of backtest, but when you stop it and remove the hook for the visual mode here you can save a lot of time with the next one, so let’s start it and look at the graph tab, here is the result, we just made two hundred seventy-four dollars of profit, let’s do another test with the same settings. Here we are! This time we made one hundred fifteen dollars profit, let’s do a third one and this time the result is one hundred thirty-nine dollars profit. Now we have three different results with the same entry but they are all different because it’s a random entry and now we would like to do a mass test for that, this is the source code from the last video and here we have a variable called mass test, it’s extern that means that it can be modified without changing the source code and to change it we click on settings, expert properties, inputs, here is our variable, it has a value of one, it starts with one, the step is zero and the stop is also zero, so let’s change that to ten and this to one, and now we should see something that starts with the first test and counts up by one until it reaches ten, but when you click on start you will see absolutely nothing that has changed, except for the different profit and the reason is that you need to click on optimization and once you do that and start another test you will see a tab called optimization results and these are our end results. It takes a little while. Here is another tab called optimization graph, each of those dots here stands for a result and right now most of the results are positive. Let’s sort the results. So I would now like to start from zero up to twenty and if I would change the step value here to two it would start with just zero and would jump to two and to four and to six and so on but with a step value of one each step is performed. That step value will become interesting later when we talk about other kinds of mass testing but for now, click on ok and start another test and you see that the first ten results are already here, that is something that is kind of strange with mql4 and Metatrader 4, it seems that Metatrader is using the previous results and it only calculates the next ten. Here we are! We did twenty tests, it looks like we made a profit most of the time, that’s also what we see here on the optimization graph. You can now right-click into the report, select save as report, I will call this one mass test report and click on save, this is how it looks like, here are the results, you will see the number of total trades, the profit factor and so on, and we used a random based entry to do that and that is the power of automated trading because other traders only see this year and this is even slower but you are able to do a lot of mass tests in a very short time and in this video you have learned how to do that with a random generated entry and you can do it yourself with just a few lines of mql4 code.
    6 min
  • MQL4 TUTORIAL BASICS – 50 SIMPLE RANDOM ENTRY EXPERT ADVISOR
    In this video we are going to create random based entry signals, that might sound a little strange but I promise that the results will be very interesting, so let’s find out how to do that with mql4. To get started please click on the little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple random entry ea, click on continue, continue and finish. Now you can delete everything above the on tick function and the two comment lines here, we start by creating an integer variable with the modifier extern; that will allow the user to change the setting for this variable and it will become interesting in the next video when we are going to create mass tests. Inside of the on tick function, we start by creating a signal but we don’t assign any value here because we are going to calculate that now. First, we start with this function, it is called math srand and when you mark it and press F1 you will learn that it sets the starting point for generating a series of pseudorandom integer numbers and to get a unique starting value we use get tick count as a parameter because get tick count returns the number of milliseconds that have passed since we have started our system and that number will always be unique and therefore the combination of these two functions will always create a unique series of random numbers. To calculate our random number we use math rand, that’s a different one, this one is with an additional s and math rand returns pseudorandom integer within the range of zero to thirty-two thousand but with this expression, we will get two different values, either a zero or a one and if our random number equals zero we want to buy so we assign the value buy to our signal. Otherwise, if the random number equals one, we want to sell so now we assign the value sell to our signal. And if our signal equals buy and the value for orders total is zero – that would mean that we have no open orders and we have a buy signal – and now we use order send to buy ten micro lot. Otherwise, if the signal equals sell and orders total is also zero – that would mean we have no open orders and a sell signal – and now we use order send to sell ten micro lot. Finally, we use the comment function to output the text the current signal is followed by the calculated signal. That’s about it. If you don’t understand what all the code here does or if this was too fast for you maybe you want to watch one of the other videos in this basic video series or maybe even the premium course on our website might be interesting for you. For now, please click on the compile button, you shouldn’t get any errors and if that is the case you can click on the little button here or press F4 to go back to Metatrader. And in Metatrader you want to right-click into an empty chart, click on template, save template and save the template as tester dot tpl, you can overwrite the old value because tester dot tpl is what we will see when we start the strategy test and to do that please click on view, strategy tester or press control and r on your keyboard, please pick the new file, simple random entry ea dot ex4, mark the visual mode here and start a test. Here we are! The expert advisors running, let’s go to full speed and you should get some results here so basically the expert adviser is working but it’s a random entry so let’s stop that, disable the visual mode, start a new test. In my case we have made a net profit of five hundred twenty-three dollars and forty cents now I will repeat the test and because it’s a random entry we should now get a different result. We can already see that this time the profit was only eighty-three dollars and fifty-four cents but it is still a random based entry and it is a profit. Let’s do another one! And this time we made seven hundred and twenty-nine dollars profit so it is possible to use a random base...
    7 min
  • MQL4 TUTORIAL BASICS – 49 SIMPLE WILLIAMS PERCENT RANGE EA
    In this video we are going to create a simple expert advisor for the Williams Percent Range oscillator that you see right here on the chart, it will create buy and sell signals so let’s find out how to do that with mql4. To get started please click on the little icon here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple Williams Percent Range ea, click on continue, continue and finish. Now you can delete everything above the on tick function and the two comment lines here, we start by creating a string variable for the signal but so far we will not assign any values here because we are going to calculate that now. And to do that we use the included iwpr function that comes with mql4, it needs a few parameters, the first one is for the current symbol on the chart, the second one for the currently selected period, the third one here is for the number of candles because when you click on insert, indicators, oscillators, Williams Percent Range, you will see that it is calculated based on fourteen candles. Now let’s click on ok, right-click into the chart, select template, save template and save it as tester dot tpl because this is the one that you are going to see in the strategy tester, so please click on save, you can replace the current one. The last parameter here is for a shift value, we don’t need that so it’s zero and now we want to check if the current wpr value is below minus eighty, let’s actually call that value and that would be true when the signal is below the lower dotted line here and if that is the case we want to buy so we assign the word buy to our signal. In the other case if the wpr value is bigger than minus twenty – that would mean that the signal is above this upper dotted line here – and in that case, we want to assign sell to our signal. And if our signal equals buy and orders total delivers a value of zero – that would mean we have no open orders – and a buy signal and if that is the case we use order send to buy ten micro lot. Otherwise, if our signal equals sell and we have no open orders we would use order send to sell ten micro lot. Finally, we want to create a chart output that is done with the comment statement, we will see the text the current signal is and the calculated signal. Okay, that’s it so far. If this was too fast for you or if you have no idea what all the code here does maybe you want to watch one of the other videos in this basic video series first or maybe even the premium course on our website might be interesting for you. For now, please click on the compile button or press F7 on your keyboard, I don’t have any errors here and if this is also the case for you you can click on a little button here or press F4 to go back to Metatrader. And in Metatrader please remember to save the template for the strategy tester and now we click on view, strategy tester or press control and r, please pick the new file simple williams percent range ea dot ex4, mark the option for the visual mode here and start a test. And here is our little expert advisor at work, we see the first buy trade here so the program is working like expected and in this little video you have learned how to code an expert advisor for the Williams Percent Range oscillator and you have coded it yourself with a few lines of mql4 code.
    6 min

About MQL4TUTORIAL.COM

From the publisher's feed

MQL4 Tutorial for Metatrader 4 or MT4 about automated trading, trading robots, MQL 4 and MQL programming