Libraries: Report - page 3

 

Forum on trading, automated trading systems and testing trading strategies

Expert Advisors: Quantum 103

fxsaber, 2017.09.26 09:55 pm.

Backtest result on real ticks on MT5

Standard MT5 report

Custom report (MT4-style)


Attached MT4-style MT5 backtest report, because the standard report is hard to read - see both in the trailer.

You can clearly see the impact of slippages and commissions on the MT5 backtest result of this EA.

 
Does this miracle work correctly with netting accounts?
 
Aleksey Vyazmikin:
Does this miracle work correctly with netting accounts?

Not if there are in/out trades. This is a current limitation of MT4Orders, not Report.

 
fxsaber:

If there are in/out trades present, no. This is a current limitation of MT4Orders, not Report.

Sad. Are there any plans to develop MT4Orders in this direction, or is it not in the plans yet?

 
Aleksey Vyazmikin:

Sad. Are there any plans to develop MT4Orders in this direction, or is it not in the plans yet?

The restriction concerns only history, not trading. I can't make any promises.

 

Forum on trading, automated trading systems and testing trading strategies

Expert Advisors: Quantum 103

fxsaber, 2017.09.26 09:55 pm.


Attached MT4-style MT5-backtest report, because the standard report is hard to read - see both in the trailer.

You can clearly see the impact of slippages and commissions on the MT5 backtest result of this EA.


It was a mishap that I had an old version in KB for more than a year. Updated it.


I recommend to run this script on MT4 (and especially on MT5-Hedge) and see Report.htm.

#include <MT4Orders.mqh> // https://www.mql5.com/en/code/16006
#include <Report.mqh>

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


and look at Report.htm. The reason will be clear at once.

 
Explanation of numbers

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

Libraries: Virtual

fxsaber, 2018.11.13 16:01

1663332018.11.09 21:47:21.837buy0.10 (22 672.50)EURUSD1.133661.133592018.11.09 22:00:00.1571.13359-0.40-0.70tp 1.13359-700:12:38.320
1673352018.11.09 22:00:00.157sell0.10 (22 671.00)EURUSD1.133591.133512018.11.09 22:00:09.2021.13351-0.40+0.80tp 1.13351+800:00:09.045
1683372018.11.09 22:00:09.202buy0.10 (22 670.00)EURUSD1.133511.133492018.11.09 22:05:14.3341.13349-0.40-0.20tp 1.13349-200:05:05.132
1693392018.11.09 22:05:14.334sell0.10 (22 668.50)EURUSD1.133491.133382018.11.09 22:06:33.6221.13336-0.40+1.30 (+1.10)tp 1.13338+13 (+11)0, +200:01:19.288
1703412018.11.09 22:06:33.622buy0.10 (22 666.70)EURUSD1.133361.133292018.11.09 22:29:56.8061.13331-0.40-0.50 (-0.90)tp 1.13329-5 (-9)+2, +200:23:23.184
1713432018.11.09 22:29:56.806sell0.10 (22 664.60)EURUSD1.133311.133162018.11.09 22:40:39.0051.13315-0.40+1.60 (+1.30)tp 1.13316+16 (+13)+2, +100:10:42.199
1723452018.11.09 22:40:39.005buy0.10 (22 665.90)EURUSD1.133151.133422018.11.09 22:56:02.9151.13344-0.40+2.90 (+2.60)tp 1.13342+29 (+26)+1, +200:15:23.910
1733472018.11.09 22:56:02.915sell0.10 (22 670.90)EURUSD1.133441.133662018.11.09 23:50:03.2451.13365-0.40-2.10 (-2.40)tp 1.13366-21 (-24)+2, +100:54:00.330
1743492018.11.09 23:50:03.245buy0.10 (22 671.40)EURUSD1.133652018.11.09 23:54:57.4461.13349-0.40-1.60 (-1.70)end of test-16 (-17)+1, 000:04:54.201
1753492018.11.09 23:51:11.960sell limit0.10EURUSD1.133771.133612018.11.09 23:54:57.4461.1334900:03:45.486
17.40 (3 947 682.20)-69.600.00-48.60 (-73.50)-486 (-735)+249 (+24.90)


highlighted"+2, +1" - there was a +2 pip slide at the opening and a +1 pip slide at the closing. The highlighted"-21 (-24)" in the same line indicates that the profit is -21 due to sliding, but if there was no sliding, it would have been -24. I.e. MT5-tester just gave us 3 pips. The highlighted"-2.10 (-2.40)" shows that the profit in the account currency was -2.1 due to sliding, but without sliding it would have been -2.4. I.e. a gift of 0.3.


Finally, the bottom red line shows that the profit is -485 pips, but this is with the sliding. On the other hand, if without it, it would be -735 pips. The report shows that the total slip is +249 pips.

 
// The cross-platform script creates a trading history report with filters by symbol, majic, time and other parameters.

// MQL4&5-code
#property strict
#property script_show_inputs

input string inFileName = "Report.htm"; // FileName
input bool inSymbolFilter = true;       // true - Current Symbol, false - All Symbols
input long inMagicFilter = -1;          // MagicFilter (negative - All Magics)
input bool inPending = false;           // Pending (true - include)
input bool inBalance = false;           // Balance (true - include)
input datetime inStartTime = 0;         // OrderCloseTime >= this time
input datetime inEndTime = INT_MAX;     // OrderCloseTime <= this time

input bool inOpenBrowser = true; // Open Browser with Report - DLL!

#import "shell32.dll"
  int ShellExecuteW( int hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, int nShowCmd );
#import

#ifdef __MQL5__
  #include <MT4Orders.mqh> // https://www.mql5.com/en/code/16006

  #define  BASEPATH (TerminalInfoString(TERMINAL_PATH) + "\\MQL5\\Files\\")
#else // __MQL5__
  #define  BASEPATH (TerminalInfoString(TERMINAL_PATH) + "\\MQL4\\Files\\")
#endif // __MQL5__

#include <Report.mqh> // https://www.mql5.com/en/code/18801

void OnStart()
{
  REPORT_FILTER Filter;

  Filter.Symb = inSymbolFilter ? _Symbol : NULL;
  Filter.Magic = inMagicFilter < 0 ? -1 : inMagicFilter;
  Filter.Pending = inPending;
  Filter.Balance = inBalance;
  Filter.StartTime = inStartTime;
  Filter.EndTime = inEndTime;

  if (REPORT::ToFile(inFileName, Filter) && inOpenBrowser && MQLInfoInteger(MQL_DLLS_ALLOWED))
    ShellExecuteW(0, "Open", BASEPATH + inFileName, NULL, NULL, 3); // https://www.mql5.com/ru/forum/23223#comment_1741093
}
Now it's convenient.
Files:
 

Just a thought, why not make it possible to dump a report once a day (on demand) and a script to process these reports, including information from different accounts into one?

The task is relevant for analysing the results of advisors' work on different accounts, including those with the same mages, and for solving the problem of history deleting by some brokerage companies.

 
Aleksey Vyazmikin:

Just a thought, and why not make it possible to discount the report once a day (on demand) and a script to process these reports, including information from different accounts in one?

The task is relevant for analysing the results of EAs work on different accounts, including those with the same mages, and for solving the problem of history deleting by some brokerage companies.

The script above does the analysis like ***. Only everything is very fast and clearer. This is for real, of course. I use bibla myself in Tester and in virtual.

Information on slippages (only MT5-Hedge) - I have not seen any analogues. Perhaps I will make one for Netting. But this task is not Report, but another bible....