Report – library MetaTrader 5

This library is a revised version of an excellent script released in 2006, adjusted with modern MQL possibilities in mind. Some features have been removed, and new features have been added.

In both platforms (MetaTrader 4/5), you can run the following script to save a report (in the form of MetaTrader 4):

#include <Report.mqh>

void OnStart()
{
  REPORT::ToFile("Report.htm");
}

and see a generated HTML report in the resulting file:

It can be especially useful in MetaTrader 5, which does not provide visual HTML reports like MetaTrader 4 (as of the time of publication).

Additional possibilities of the library in MetaTrader 5

  • Output of balance graph on the chart.

    #include <Report.mqh>
    
    void OnStart()
    {
      REPORT::ToChart(); // Output of balance graph on the chart
    }
    
  • Automatic saving of reports in the tester at the end of a single test and during optimization.

    At the end of a single run in the tester, the library can automatically save a report on testing results of any Expert Advisor. Add to the EA source code the following lines:

    #define REPORT_TESTER // Reports will be automatically written in the tester
    #include <Report.mqh>
    

    The same lines will enable saving of reports of each optimization run.

    It allows you to immediately evaluate results without waiting for the optimization completion. After the end of optimization, you will not need to launch separate tests and wait for results. It allows you to visually evaluate all results calculated by the optimizer. Balance graphs (PNG files) of multiple separate runs can be shown on one chart as thumbnails.

Alternative:  Bollinger Bands - EA MetaTrader 5

Note

In MetaTrader 5, the library uses the MetaTrader 4Orders library.

To add balance charts and input values to reports in the optimization mode, you need to register the TypeToBytes library.

#include <TypeToBytes.mqh> // 
#define REPORT_TESTER // Reports will be automatically written in the tester
#include <Report.mqh>


📈 ROBOTFX MetaTrader Expert Advisors and Indicators to maximize profits and minimize the risks