Advanced Optimization Report for MT5

Are you optimizing in Meta Trader 5 (MT5)? Use an expanded and more visual representation of optimization statistics with the advantages of HTML.
User-friendly graphics. 44 evaluation criteria instead of 8. Filters for any criterion and threshold. Previews of trading charts for all passes without running a single test.
Everyone who optimizes trading strategies should have this script.

Features and Improvements:

Charts:

- 1D graphs for individual optimized parameters are made easier to understand. MT5 shows values spaced on the x-axis, i.e. separately. The Optimization Report shows them all on the same graph, but with lines of different colors, so they can be distinguished from each other and compared. The average value of each line is shown by a dotted line of the same color. The maximum or minimum values are not always the best. The average will show how much one parameter is generally better than the others. Choose what is more important to you. An assessment tool is provided.
It is difficult to compare graphs located at a distance of 100-500-1000 pixels from each other. As in this example ----a screenshot-- And when they are superimposed on each other at the same scale, everything is immediately visible ---a screenshot--.
MT5 shows charts one at a time. Here you will see them all at once, which is also convenient for analysis.
To consider in detail some parameter values, you can filter them out. For example, select TP from 100 to 500, the graphs will be redrawn and you can only view them. Similarly, you can change the graphs using any filter. Very convenient.
When loading, the charts show the profit on the Y-axis. You can show any evaluation criterion. To do this, sort by the desired column.

- An important difference between our graphs and MT5 is if the optimized parameter is made an enum. MT5 shows its serial number (for example, 1,2,3,4,5,6,7,8,9), which makes it difficult to understand which value is used (5,10,20,50,70,100,200,500,1000). It is convenient to use such enumerations to change values proportionally, for example, SL/TP. If after 10, it is rational to check the value of 20, then after 500 it is stupid to check 510,520... optimizing in increments of 10 from 10 to 1000 will take 10+ times longer than enumerating. The "Optimization Report" shows exactly the value, not its sequence number. This is one of the most important reasons for creating this version of the report.

- 2D graphs for all pairs of optimized parameters have also become more visual. Instead of mosaics with colored squares, minigraphs are drawn. The first parameter in the pair is represented by one of the colored lines (for example, 5 lines), the second parameters are separated by vertical dotted lines along the X axis (for example, 4 columns). In total, we have 5 lines in 4 columns = 20 mini graphs. In MT5, it was drawn as 20 colored squares. Graphs are better understood.

- You can change the type of charts using the Stairs/Lines switch

- If you click on any graph, it will open on a large scale in Google charts, which have a zoom with the mouse wheel and it shows the exact values on the Y axis.

Optimized variables statistics:

- In this section, you will see statistics for each parameter being optimized (graph 1D). For each of its values, you will see: the maximum, average, median, minimum value of the selected evaluation criterion and the number of passes with it. The average value will be displayed on the 1D chart.
- the same statistics for all parameter pairs (graph 1D).
Based on the average or median value, it is possible to estimate which of the variants of the optimized parameter gives the best strategy results on average. For example, you can choose the maximum average for profit, and the minimum average for drawdown, etc.

Data:

- Reads the opimization data from the .opt file. It contains a lot of information that you don't see in the MT5 report. The "Optimization Report" script will show you everything in HTML form in the browser.
- 8 tables with strategy evaluation criteria as in MT5 are displayed. And additionally 35 other criteria for evaluating the strategy. They are grouped into groups: Standard criteria, as in MT5, Profit/Loss, Balance, Equity, Trades, Sequential, and Others.
There are additional control buttons under the detailed report table.:
- If you click on the "Edit Columns" button, you can hide the columns that you are not interested in evaluating. This way the table will take up less space and will show only the necessary information.
- If you click on the "Hide Rows" button, the [-] buttons will appear in the Pass column in each row. Clicking on them will hide these lines. To return all the rows, click "Show All Rows"
//. Unfortunately, the comprehensive criterion has not been added to the .opt file and cannot be shown until it is added to the .opt file by the Meta Quotes developers. You can ask them about it on the forum and if there are a lot of requests, they can do it in one of the following builds. It will also be useful to add the expectation value (average per trade) in points (currently only in money).
- The Trades and Relative drawdown percentage equity columns are present in their group and copied to the Standard criteria, as in MT5. For convenience.

Groups of evaluation criteria:

---screenshots--

Filters:

- MT5 has only 5 filters for certain thresholds. --screen-- In the "Optimization Report" script, you can apply filters to all parameters. You can apply >= and < of any threshold to each one. When you enter a value and press Enter, or after losing the focus of the input field, the results table will be rebuilt, the graphs will be redrawn, and statistics (min,max,avg, median) will be recalculated. The recalculation will take place only for the remaining rows.

Sorting:

- Any column can be sorted. To do this, click on its name. Repeated clicks change the sorting order (ascending/descending). The sorted column is highlighted in color.
- If, when sorting by one of the columns, several row values are the same, then they are sorted among themselves in descending order of profit.
- Additional sorting. If you press the S button in any column, the first row will be accepted as the maximum in the column, only rows that are less than the previous values in this column will be shown below, the rest will be hidden. Clicking again will show more lines than the previous ones. This sorting/filtering can be done on multiple columns at the same time.

Other features:

- The values are formatted in an easy-to-read monetary format. Instead of 123456789.01, in which it is difficult to understand how many thousands and millions there are (you need to count the number of digits), you will see 123 456 789.01 here it is immediately visible.
- Since there are many columns, they do not fit the width of the screen and you need to use horizontal scrolling. Minor parameters have been moved to the end, to the Other group.
- Pagination has been done for the lines. You can display from 5 to 10,000 lines on a single page. You can use the arrow keys to navigate through the pages: <- /\ and -> \/
- When you click on any cell in the table, the row and column are highlighted in color. In this case, the settings of the selected passage are copied to the clipboard. You can go to the settings tab in the tester and press Ctrl-V there, the settings will be applied. Additionally, in the Pass column, the pass number is made by a button, when clicked, the pass_XX.set settings file will be downloaded, then it can be saved to the desired location, for example, to the folder with the HTML report.
- The minimum equity in the calculation of our function is less than in the MT5 report because ln checks it on every tick. Presumably MT5 can check it on every M1 or something else. The roles match.

 

Balance and equity charts:

If you have access to the Advisor's code, you can insert  a code into it that will save the balance and equity lines. Then these graphs will be shown in the report for each pass. To do this, you do not need to run single tests for each option of interest. It will save a lot of time.
- Balance charts show transactions on a time scale, rather than an equal step between transactions. It happens that there are 2 years between transactions, and they stand side by side, as if there were 5 minutes between them.
- Graphs are initially shown with a height of 50 pixels. The length of the charts can be customized.
When you click on the graph, it expands to a height of 255 pixels - for compact files, each point is encoded with the 1st byte with 256 height options. When clicked again, the chart collapses.
The Small/Big checkbox expands all graphics to 255 pixels.
The Profit/Balance checkbox changes the minimum and maximum values for profit or balance on the charts.
The testing period is shown on the graph in the same block.
If the test was conducted with a forward, then it will be to the right of the backtest graph. Its width will be proportional to the testing period. That is, if forward = 1/3 of the entire testing period, then the backtest and 1/3 of the forward test will take 2/3 of the width. That is, the time scale will be the same for both graphs.
The chart width can be selected when configuring conversion. 200-300 pixels are recommended, because this is enough for perception, as can be seen in the examples. But it is possible up to 2000. The file size will be 10 times larger. Values over 2000 will be reduced to 2000.
- The added code will also add a comprehensive optimization criterion to the report (it is not available in the .opt file), mat. expectation in points, equity parameters, Sharpe coefficients. You can add Sortino coefficients, Titov test coefficients, and they are calculated using deltas rather than logarithms. As well as the total: Volume(turnover), Profit (excluding swaps, commissions and fees), Swap, Commission, Fees - their sum is equal to the total profit. The division may be interesting for cost analysis.
You can also output the Gross ratio, the number of repeated errors separately for Buy and Sell.
Other evaluation criteria may be added in future versions. If you have an interesting criterion with the implementation code, ask the developer to add it.