MQL4 TUTORIAL BASICS – 51 HOW TO DO MASS TESTING

video
play-sharp-fill

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.