Libraries: Report - page 13

 
fxsaber #:
I am using b4070 for now.

It compiles on 4067. Please, tell me, do missing values in the Slippage column mean zero slippage (for both entree and exit)?

Files:
 
leonerd #:

Can you please tell me if the missing values in the Slippage column mean zero slippage (for both entree and exit)?

For market orders slippage can be determined only by analysing tick history. This has not been implemented yet. Deferrals and SL/TP give information about slippage at once, while a market does not.

 
fxsaber #:
I'm using b4070 for now.

They write that you need to upgrade to 4075. I have 4076 and it doesn't compile as well. Errors like "mismatched #ifdef/#endif pair".


 
leonerd #:

They say you have to upgrade to 4075. I have 4076 and it doesn't compile as well. Errors like "mismatched #ifdef/#endif pair".

 
I had to make tests with a large number of transactions. If they were > 50,000, the tester consumed gigabytes of memory while creating the report file, and then the browser did the same. And it is extremely difficult to view such a file - constant redraws and freezes. And with about 80 thousand lines the memory ran out completely.
To avoid all this I added this code, which by default outputs the first and last 1000 lines to the file. Usually by eye line by line there was no need to check more. If you really need it, you can change the output to all lines by input.
.
enum showType {Show_1000_First_and_Last_Deals, Show_All_Deals };
sinput showType Report_Print_First_Last_1000 = 0; // Print all lines or partially, for speed

....
// in the loop of string search changed the string (~2130)
          StrSum += "<tr " + ((bool)(Count & 1) ? "" : "bgcolor=#E0E0E0 ") +
                 ((OrderType() >= OP_BALANCE) ? "style=\"color:blue\" ": "") + "align=right>" + REPORT::OrderToString(Count, Filter) + "</tr>\n";

// on the lines

if( Report_Print_First_Last_1000 == Show_All_Deals) {
          StrSum += "<tr " + ((bool)(Count & 1) ? "" : "bgcolor=#E0E0E0 ") +
                 ((OrderType() >= OP_BALANCE) ? "style=\"color:blue\" ": "") + "align=right>" + REPORT::OrderToString(Count, Filter) + "</tr>\n";
}else{//Show_1000_First_and_Last_Deals
   if(i<1000 || i > Total-1001){
          StrSum += "<tr " + ((bool)(Count & 1) ? "" : "bgcolor=#E0E0E0 ") +
                 ((OrderType() >= OP_BALANCE) ? "style=\"color:blue\" ": "") + "align=right>" + REPORT::OrderToString(Count, Filter) + "</tr>\n";
   }else{REPORT::OrderToString(Count, Filter);}// without printing, to calculate the balance
}
It may be useful for other users.
 
Forester #:
I had to do tests with a large number of transactions. If they were > 50,000, the tester consumed gigabytes of memory while creating the report file, and then the browser did the same. And it is extremely difficult to view such a file - constant redraws and freezes. And with about 80 thousand lines the memory ran out completely.
To avoid all this I added this code, which by default outputs the first and last 1000 lines to the file. Usually by eye line by line there was no need to check more. If you really need it, you can change the output to all lines by input.
Might come in handy for other users.

Would make a spoiler for the browser. For large reports it helps.

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

Errors, bugs, questions

fxsaber, 2023.10.18 15:00

Rating of the fastest browsers when opening large html-tables - steutments. Summary result for a table with 35K rows.

Browser LengthTime (sec)
MyPal 24
Basilisk 35
PaleMoon 50
K-Meleon 52
Thorium 55

My unequivocal choice is MyPal.


 
Forester #:
I had to make tests with a large number of transactions. If they were > 50,000, the tester consumed gigabytes of memory while creating the report file, and then the browser did the same. And it is extremely difficult to view such a file - constant redraws and freezes. And with about 80 thousand lines the memory ran out completely.
To avoid all this I added this code, which by default outputs the first and last 1000 lines to the file. Usually by eye line by line there was no need to check more. If you really need it, you can change the output to all lines by input.
Might come in handy for other users.

I'd like to see such html file (with brakes due to 50000 entries) - surely it can be optimised.

As for the tester, you can probably profile mql5 too and find out if there are any memory bottlenecks.

 
Stanislav Korotky #:

I'd like to see such an html file (with brakes due to 50000 entries) - surely it can be optimised.

As for the tester, you can probably profile mql5 too and find out if there are any memory bottlenecks.

https://www.mql5.com/ru/blogs/post/755500

OnTickMulti - с добавленными пересчетом прибыли в валюту депозита, свопами, комисссией в % за лот.
OnTickMulti - с добавленными пересчетом прибыли в валюту депозита, свопами, комисссией в % за лот.
  • 2023.12.25
  • www.mql5.com
Текущий вариант OnTickMulti https://www.mql5.com/ru/code/47647 считает прибыль в валюте каждого символа или можно получить в пипсах. Но на общий баланс они влияют в другой пропорции, согласно текущему
 
I decided to optimise the Report-a code a bit. I hope the brakes will be less.

Main:

Instead of putting align=right and bgcolor=#E0E0E0 every second line, I made a style that does it without any attributes in the HTML code

.at {text-align:right;}
.at tr:nth-child(odd) {background: #e0e0e0 !important;}

I divided the table into 3: first 2 rows with additional information, the main table with deals, the last table with test statistics. If these tables are glued together, there are some column unions like colspan=6, colspan=14, etc. This is harder for the browser to render. I made 3 simple tables without unions.

Additional: (should not speed up much)
Sometimes there is highlighting colour style="colour:#00A000", I replaced it with shorter class="sl" - no difference, just the code of the final file will be shorter. SL/TP highlighting with colour made bold for visibility.

And added styles for the 3 first and last lines.

Also in the Summary and Average columns I added a line break for values in brackets. They are sometimes long. After that the table became more compact.

The table with deals was set class="at". Full CSS code for it:

.at {border-spacing:1; border:0;text-align:right;}
.at tr:nth-child(odd) {background: #e0e0e0;}
.at td {padding: 2 px;}
.at tr:nth-child(1), .at tr:nth-last-child(1) {color:magenta;background:#eee;}
.at tr:nth-child(2), .at tr:nth-last-child(2) {color:red;background:transparent;}
.at tr:nth-child(3) td, .at tr:nth-last-child(3) td {background:#c0c0c0;text-align:center;}

.at .sl {color:red;    font-weight:bold;}
.at .tp {color:#00 A000;font-weight:bold;}
.at .r {color:red;}
.at .g {color:#00 A000;}
.at .b {color:blue;}
.at .m {color:magenta;}


Was

Became


Visually the colouring has not changed, but the code has become shorter and the probability of redrawing for huge reports with >50k deals has decreased. I compared files with 35k deals, the size has decreased by 6.5% (11.7 mb new version, 12.5 mb old version). Well, the main thing is not the size, but the speed of drawing, I hope it became higher due to the use of styles and tables without merging cells. Also added the above suggested choice of printing all rows or the first and last 1000 rows.





enum showType {Show_1000_First_and_Last_Deals, Show_All_Deals };
sinput showType Report_Print_First_Last_1000 = 0; // Print all lines or partially, for speed

The final file is attached. Maybe it will be useful for someone else.

Files:
Report.mqh  293 kb
 
Forester #:
I decided to optimise my Report-a code a bit.

I'm an absolute zero in HTML, so any suggestions for improvement are welcome.

Of course, some visual decisions are tasteful. But in terms of size and render speed - objective metrics.