Libraries: Report - page 10

 
fxsaber:

In your variant it goes only at the opening price. It is clear that this is a consequence of the BestInterval approach. But in the general case it is probably not quite right.

Although, considering that the library is used by 2.5 people, there is no sense to make it "correct". I will introduce this type of filter

I actually use it for BestInterval. That is, I don't keep several virtual-mediums: one full-fledged and one with an interval. I keep one and filter it in the output at once, that's what I needed to do.


Probably it would be more correct to set it like this

OrderTimeOnly <= this.EndInterval

There is no midnight there anyway, 23.59.59 max.

 
traveller00:

In fact, I use it for BestInterval. That is, I don't keep several virtual-mediums: one full-fledged and one with an interval. I keep one and filter it in the output at once, that's what I needed to do.

I gave up this option, because the synchroniser is less generalised then.


Better than any Report-filters is to create your own Virtual with the necessary transactions from the general environment (Real/Virtual). And it can be fed into Report without any filters.

      const int HistoryTotal = OrdersHistoryTotal();
      
      for (int i = 0; i < HistoryTotal; i++)      
        if (OrderSelect(i, SELECT_BY_POS, MODE_HISTORY) && this.BestInterval.IsTime(OrderOpenTime()))
        {
          const ORDER_BASE Order = VIRTUAL::GetOrder();
          
          _V(Handle, VIRTUAL::AddOrder(Order));
        }


ZY I run trading logic only in one round-the-clock environment VirtualFull. VirtualBestInterval is always derived from VirtualFull, not from the trade logic.

 

Added time spent on closing a position: duration from the moment of the order to close to the closing itself. In some cases very necessary information.

And total slip in pips for each side - opening and closing. Lack of parity is a reason to think about it.

 

MT5 HTML report generates 115 seconds and takes 221 MB.

Report HTML report in MT5 takes 5 seconds to generate and takes 38 MB.


The information content of the reports is even more different.

 

On the basis of this and other previously posted libraries, I made a Tester report for any Expert Advisors.

TesterReport - альтернативный отчет тестера стратегий Metatrader 5
TesterReport - альтернативный отчет тестера стратегий Metatrader 5
  • www.mql5.com
Торговые отчеты MetaTrader 5 довольно тяжелы для восприятия. По этой причине с определенного момента разработчики добавили в Терминал более понятный режим просмотра закрытых позиций. Однако, это не
 

I want to thank fxsaber for this and so many other useful contributions to the community!

I often use this library to generate custom reports for specific symbols and date ranges.

One thing I haven't been able to do is use the report filters with the ToChart() method. The filters work with the ToFile() function for generating HTML reports but not ToChart().

For example:

#include <MT4Orders.mqh>
#include <Report.mqh>

void OnStart()
{
   REPORT_FILTER Filter;
   Filter.StartTime = (TimeLocal()-2880);
   Filter.EndTime = TimeLocal();
   Filter.Magic = 0;
   REPORT::Calculate(Filter, true);   
   REPORT::ToChart(); //The equity chart is generated without filters
}

I tried to modify the ToChart() function to accept filters but it's beyond my coding skills I'm afraid!

I'd greatly appreciate the author's feedback or anyone else using this library, thanks.

 
mqtrader #:

The filters work with the ToFile() function for generating HTML reports but not ToChart().

REPORT::ToChart(REPORT_BALANCE, 0, 0, CURVE_NONE, NULL, false);
 

fxsaber #:

REPORT::ToChart(REPORT_BALANCE, 0, 0, CURVE_NONE, NULL, false);
This generates an empty balance chart for me. Perhaps I'm doing something wrong. I still can't get ToChart() to generate a chart with filters applied. Is there anything else which needs to be declared before calling ToChart() so that REPORT_FILTER is applied to the calculation?
 
mqtrader #:
This generates an empty balance chart for me. Perhaps I'm doing something wrong.
Print(Filter.ToString());
 
fxsaber #:
Print(Filter.ToString());
It's working now, thank you so much @fxsaber!