• Introduction to Mass Testing with Random Entries (00:00 – 00:13) Introduction to mass testing in MQL5 using buy and sell signals created by a random generator.
  • Explanation of Visual Mode Testing and Quick Test Example (00:13 – 00:24) Explanation of visual mode testing in MetaTrader and a quick test example for the year 2018.
  • Demonstration of Different Results with Random Entries (00:24 – 00:59) Repeating the test with the same settings, demonstrating different results due to random generated entries.
  • Setting Up for Mass Testing in MQL5 (00:59 – 01:44) Instructions on setting up for mass testing, including modifying the source code and using an external variable for mass testing.
  • Enabling Optimization and Adjusting Settings for Mass Testing (01:44 – 02:07) Enabling optimization in the MetaTrader strategy tester and adjusting settings for mass testing.
  • Viewing Optimization Results and Analyzing Profitability (02:07 – 02:34) Viewing optimization results, analyzing the number of profitable outcomes compared to losses.
  • Exporting and Analyzing Results in a Spreadsheet (02:34 – 03:09) Exporting results to XML, opening in a spreadsheet, and analyzing the profit column to calculate the overall result.
  • Conclusion on the Power of Automated Trading and Mass Testing (03:09 – 03:39) Concluding remarks on the power of automated trading and the ability to perform hundreds or thousands of tests with mass testing.
  • Encouragement to Try Mass Testing with MQL5 Code (03:39 – 03:24) Encouraging viewers to try mass testing with random based entries using MQL5 code.


In this video we are going to do mass testing with a random entry, we use buy and sell signals here, those are created by a random generator.
You might be familiar with this kind of testing, that’s the visual mode but it’s also possible to remove the hook here.
Let’s do a quick test here for the year twenty eighteen, click on start, here is the graph, it only took a few seconds. In this case, we made a profit of three hundred and one dollars and forty-eight cents.
Let’s repeat it with the same settings, this time we lost twenty-four dollars and seventy-seven cents, let’s do one more.
And this was also a loss, we lost one hundred ninety-three dollars, so for the same time span we have different results each time because we are using random generated entries and now we would like to do a mass test, so let’s go to settings, this is the source code from the last expert advisor that we have created in the video before and here we have an input value, it’s an integer called mass test and this is an external variable that can be changed without changing the source code and that’s exactly what we need because this makes it possible to set the values for the mass test here but right now it doesn’t work, we can’t change anything because before we do that we need to enable the optimization here.
So let’s click on optimization and choose fast generic based algorithm, now we go back to inputs and this time we can change the value here, so let’s click on start and now you should see some optimization results on this tab here. We did fifteen tests in a few seconds, each value here is represented by a dot here and all the dots that are above this mark here stand for a profit, so I would say we had more profitable results than losses but we want to find out exactly.
So let’s right-click here, select export to xml, I will call this file masstest dot xml, save it, this is what it looks like in your web browser, not very spectacular but it’s also possible to open it in a spreadsheet calculation.
Here we are, this is the profit column and now we can calculate the end result here and we made an overall profit of two thousand nine hundred and twenty-one dollars even with some minor losses here that could still be random so you will be able to do a hundred or even a thousand tests with this kind of mass testing and that is the power of automated trading because discretionary traders only see this kind of information and they see it much slower but now you know how to do mass test with random based entries in a very short time and you can do it yourself with a few lines of mql5 code.