Libraries: Report - page 2

 
Stanislav Korotky:

Of course they are different. I just wonder why a programme running on the agent should return the TERMINAL_BUILD of the local terminal? If it does (though I doubt it), it looks like a bug.

No, it will return its own build - the Agent.

 
fxsaber:

No, she's gonna get her Agents' build back.

Well, what did you want? Not the agent's build?

 
Stanislav Korotky:

Well, what did you need? Not an agent's build?

Maybe we misunderstood each other.

 
fxsaber:

It is not available, but you can do it this way

// Report with chart under MT4
#property strict

// https://www.mql5.com/en/docs/standardlibrary/graphics/cgraphic
#include <Graphics\Graphic.mqh> // MQL5\Include\Graphics\Graphic.mqh
#include <Report.mqh> // comment out lines 295, 350, 382, 404, 434, 455.

void OnStart()
{
// REPORT::ToChart(); // outputs the chart to chart
  REPORT::ToFile("Report.htm"); // saves the report together with the graph
}


In MT4 compiler the library from MT5"Graphic.mqh" as well as "Curve.mqh" which is used in "Graphic.mqh" is not compiled - platform incompatibility.
 
Sergey Kolemanov:
In MT4 compiler the library from MT5"Graphic.mqh" as well as "Curve.mqh" which is used in "Graphic.mqh" is not compiled - platform incompatibility.

It is compiled

Forum on trading, automated trading systems and testing trading strategies.

Features of mql4 language, subtleties and techniques of work

fxsaber, 2017.07.23 12:46 pm.

In continuation of the topic of launching MQL5 libraries under MT4

#property strict

// https://www.mql5.com/en/docs/standardlibrary/graphics/cgraphic
#include <Graphics\Graphic.mqh> // MQL5\Include\Graphics\Graphic.mqh

void OnStart()
{
  double Y[] = {1, 2};
  
  GraphPlot(Y);
}
'Test.mq4'      Test.mq4        1       1
'Graphic.mqh'   Graphic.mqh     1       1
'ArrayObj.mqh'  ArrayObj.mqh    1       1
'Array.mqh'     Array.mqh       1       1
'Object.mqh'    Object.mqh      1       1
'StdLibErr.mqh' StdLibErr.mqh   1       1
'Curve.mqh'     Curve.mqh       1       1
'Canvas.mqh'    Canvas.mqh      1       1
'FileBin.mqh'   FileBin.mqh     1       1
'File.mqh'      File.mqh        1       1
'Rect.mqh'      Rect.mqh        1       1
'Axis.mqh'      Axis.mqh        1       1
'ColorGenerator.mqh'    ColorGenerator.mqh      1       1
check operator precedence for possible error; use parentheses to clarify precedence     Canvas.mqh      4329    32
check operator precedence for possible error; use parentheses to clarify precedence     Canvas.mqh      4329    34
check operator precedence for possible error; use parentheses to clarify precedence     Canvas.mqh      4329    37
check operator precedence for possible error; use parentheses to clarify precedence     Canvas.mqh      4329    39
check operator precedence for possible error; use parentheses to clarify precedence     Canvas.mqh      4329    42
check operator precedence for possible error; use parentheses to clarify precedence     Canvas.mqh      4329    46
0 error(s), 6 warning(s), compile time: 132 msec                1       7
 
fxsaber:

As it turned out, the library can be useful when dealing with "Single run does not match Optimisation result" situations.

Currently, the only thing missing is the Agent's build data in the report on which the calculation was made.

The Agent's build has been added to the report.


Add these lines to the Expert Advisor

#include <TypeToBytes.mqh> // https://www.mql5.com/en/code/16280
#define  REPORT_TESTER // The tester will automatically record reports
#include <Report.mqh>

and right during Expert Advisor Optimisation we get reports for each calculated pass.


If you notice that a single run does not coincide with the optimised one, compare the build from the report with the build of the terminal. If they do not coincide, it is most likely the reason for different results.

 
fxsaber:

Compiled


I have looked through your links, I didn't understand what I need to do to use "Graphic.mqh" in MT4, can you tell me more.

And one more thing: in the HTML report created in MT4 (not checked in MT5) there is incorrect display on the symbol NZDUSD:


 
Sergey Kolemanov:

I have looked through your links, but I don't understand what I need to do to use "Graphic.mqh" in MT4, can you be more detailed?

Install MT5 and copy all the contents (with subfolders) of the MQL5\Include catalogue into the MQL4\Include of your MT4 terminal.

One more thing: in the HTML report created in MT4 (I haven't checked it in MT5) the NZDUSD symbol is incorrectly displayed:

Yes, this is a bug, the nature of which is clear. Tried to get the Moderator to update the library today. I don't want to abuse it, so I will post the fixed version later.

 
fxsaber:

Install MT5 and copy all the contents (with subfolders) of the MQL5\Include catalogue into the MQL4\Include of your MT4 terminal.

Thanks for your help, I figured it out). I have MT5 installed, I just copied not the MQL5/Include directory, but only one subfolder MQL5/Include/ Graphics.
 
fxsaber:

I'll post the corrected version later.

It is under moderation. At the same time I added the name of the tester symbol, optimisation settings for each input parameter, server name (to understand what quotes the test is on, if not a custom symbol) and account currency.

At the moment, MT5 tester does not mention anywhere about the custom symbol flag of the symbols it is testing against when compiling test reports. The library reports contain this information.