MetaTrader 5 Strategy Tester: bugs, bugs, suggestions for improvement - page 41

 
Slava:
And when the trade starts, it will load another symbol - EURUSD

No, it won't load. Looked in the visualiser, everything is correct - one symbol during trading.

 
fxsaber:

The custom symbol has all currencies equal to the account currency. I.e. the mode is almost similar to "by pips", no need to connect other symbols to calculate margin, etc.

On the server where there is a commission (reproduced on ForexTimeFXTM-Demo01, EUR, Hedge) in the mode by real ticks after the first trade another symbol from the standard ones is connected. And everything, of course, counts much slower than it should.


Everything works correctly on MQ-Demo, where there is no commission (and this, incorrectly, because the commission correctness test cannot be performed on the main demo server).


Is this problem being reproduced?

Because of this bug, if a commission is needed, the optimization is severely slowed down.

 

Is it possible to display the position number on this slider?

I click on the slider and use the LEFT/RIGHT keyboard keys to change the speed. Sometimes the penultimate speed is needed. You cannot visually see exactly where the slider is at the moment. And it is very easy to select the last speed.

Once it is selected, the Viewer freezes. And you can throw all the results away. A digital speed aid like the one on the screen would be nice.


ZS It turns out that if you don't make a trade, the maximum speed in the Visualizer doesn't cause a hang. It turns out almost dead hover is due to trading operations.

 

There are some people who don't understand why the MT5 Tester shows different backtest results than previously used competitive testers.

Below is a reproduction of this.


On MQ-Demo, EUR, Hedge in the tester we put this EA and enable DLL (we need it to automatically open HTML reports in a browser).

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

#define  VIRTUAL_TESTER // Запуск в виртуальном торговом окружении
#define  VIRTUAL_LIMITS_TP_SLIPPAGE // Лимитники и TP исполняются по первой цене акцепта - положительные проскальзывания
#include <fxsaber\Virtual\Virtual.mqh> // https://www.mql5.com/ru/code/22577

#define  REPORT_TESTER             // В тестере будут автоматически записываться отчеты
//#define REPORT_TESTER_INPUTS      // В отчете одиночного прохода будут видны входные параметры советника - требует разрешения DLL.
#define  REPORT_BROWSER            // Создание отчета с запуском браузера - требует разрешения DLL.
#include <Report.mqh> // https://www.mql5.com/ru/code/18801

int OnInit()
{
  // Если стоп/фриз-уровень не нулевой - выходим.
  return(!MQLInfoInteger(MQL_TESTER) ||
         SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL) ||
         SymbolInfoInteger(_Symbol, SYMBOL_TRADE_FREEZE_LEVEL));
}

void OnTick()
{
  static bool FirstRun = true;
  
  if (FirstRun)
  {
    MqlTick Tick;
    
    if (SymbolInfoTick(_Symbol, Tick) && Tick.bid && Tick.ask/* && Tick.last*/)
    {
      // Сформировали комментарий для ордера: время и цена текущего тика.
      const string comment = TimeToString(Tick.time, TIME_SECONDS) + "." + IntegerToString(Tick.time_msc % 1000, 3, '0') + " " + 
                             DoubleToString(Tick.bid, _Digits) + "/" + DoubleToString(Tick.ask, _Digits);
                             
      OrderSend(_Symbol, OP_BUYLIMIT, 1, Tick.ask, 0, 0, 0, comment); // Выставляем BuyLimit по текущей цене

      FirstRun = false;
    }  
  }    
  else if (!OrdersTotal()) // Если нет открытых ордеров - выходим.
    TesterStop();
  
  if (OrderSelect(0, SELECT_BY_POS) && (OrderType() <= OP_SELL)) // Выставляем TP позиции по текущей цене
    OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), OrderClosePrice(), 0);  
}


In the settings tab of the Strategy Tester press CTRL+V for these lines.

[Tester]
Symbol=EURUSD
Period=M1
Optimization=0
Model=4
FromDate=2019.12.13
ToDate=2019.12.14
ForwardMode=0
Deposit=100000
Currency=EUR
ProfitInPips=1
Leverage=100
ExecutionMode=0
OptimizationCriterion=6
Visual=0
[TesterInputs]
VirtualTester=false
ReverseDeals=false
Report=true


Run. Browser will popup a report.

Then setVirtualTester=true and run it again, getting one more report in the browser.


The first time we traded in the built-in MT5 Strategy Tester, the second time, we traded in a third-party tester.


Let's compare the reports. Here they are in one picture (on top - the standard MT5-Tester, below - the third party one).



It is clearly seen that the results are very different. Opening and closing does not coincide by time and price. In general, everyone can decide by himself where the error is.


SZZ The workaround has come up.

 
fxsaber:

You can clearly see that the results are quite different. Opening and closing times and prices do not match. All in all, everyone can decide for themselves where the error is.

Why did MT5 only execute the limit after 2.6 seconds? Has the price moved to the other side immediately after setting it? Or there were no ticks?

 
Andrey Khatimlianskii:

Why did MT5 only execute the limit after 2.6 seconds? Did the price move to the other side immediately after setting it? Or was there no tick?

The next tick satisfying the limit was after that time. Of course, in the Tester it is possible to set a limit at the current price and not get it executed. For example, you could set a limit at an extremum.

 
fxsaber:

The next tick satisfying the limiter was after such a time. Of course, in the Tester it is possible to set a limit at the current price and not get it executed. For example, it is possible to set a limit at an extremum.

Do you specify what we are talking about: forex, exchange, rann?

There are no limit orders in forex and there cannot be.

 
Sergey Chalyshev:

Do you specify what we are talking about: forex, stock exchange, rann?

We are talking about the Tester.

 
fxsaber:

It's about the Tester.

The tester works differently in exchange and forex accounts.
 
Sergey Chalyshev:
The tester works differently on stock and forex accounts.

Instructions for playback on any character are available. Any questions - just run it.