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

 

The speed control hotkeys do not work in the Viewer.



ZS It's working. Apparently, it's some kind of tricky bug.

 
Having tested the Expert Advisor on real ticks with different brokers on MT5 with the modeling quality of 99-100% with the same input parameters I got absolutely different results: from cosmic profits to losses. Before that I purposely left MT4 because it's harder to achieve the same modeling quality there. So what was the result? How would the Expert Advisor behave in real trading? Maybe somebody will give me a good tip?
 
ganri:
Having tested the Expert Advisor on real ticks at different brokers using MT5 with the modeling quality of 99-100% with the same input parameters, I obtained absolutely different results: from a cosmic profit to a loss. Before that I purposely left MT4 because it's harder to achieve the same modeling quality there. So what was the result? How would the Expert Advisor behave in real trading? Maybe somebody will give me a good tip?

The tester+advisor is a math function that assigns a number (profit) to each vector (number series - quotes).

Correspondingly, (in general) different vectors mean different profits. And these profits do not have to obey any rule (e.g., be positive).


Different brokers mean different vectors (quotes). It does not matter whether they are ticks, bars, or something else. What matters is that the vectors are different.

 
fxsaber:

The tester+advisor is a math function that assigns a number (profit) to each vector (number series - quotes).

Correspondingly, (in general) different vectors mean different profits. And these profits do not have to obey any rule (e.g., be positive).


Different brokers mean different vectors (quotes). It does not matter whether they are ticks, bars, or something else. The main thing is that the vectors are different.

As far as I understand, in this situation, we should choose the broker that has the best results in testing the EA and work with it. Thank you.

 

In ME it is logical to separate these debugging settings.

For example, you should debug in the Terminal on EURUSD, and in the Tester on EURUSD_Custom. Now it is impossible to configure it that way.

Perhaps, it makes sense to create for the Tester a text field of settings where we can enter such settings.

[Tester]
Period=M1
Optimization=0
Model=0
FromDate=2019.07.22
ToDate=2019.07.24
ForwardMode=0
Deposit=10000
Currency=USD
ProfitInPips=0
Leverage=100
ExecutionMode=0
OptimizationCriterion=6
Visual=1

Then we will have a full flexibility of settings. The GUI is not overloaded.

Search string: Uluchshenie 001.

 
Only one Agent is enabled. Its once made visualisation window is not closed. In the Tester, Optimisation is selected and started.
2020.02.15 11:23:01.818 Tester  complete optimization started
2020.02.15 11:23:01.855 Core 1  agent still started in visual mode

The red Stop button remains lit even if you close the Viewer. Nothing happens, you have to hand-press Stop. After which it gives out.

2020.02.15 11:25:52.278 Tester  optimization finished, total passes 0
2020.02.15 11:25:52.278 Statistics      optimization done in 2 minutes 51 seconds
2020.02.15 11:25:52.279 Tester  stopped by user

And it even creates an opt-file with zero passes.


Probably need to correct the behaviour here.

Search string: Uluchshenie 002.
 

Forum on trading, automated trading systems and trading strategy testing

MetaTrader 5 Strategy Tester: bugs, bugs, suggestions for improvement

fxsaber, 2020.02.11 01:58

Long searched for the cause of the tester's strange behaviour on real ticks. Found it.
const bool Init = EventSetTimer(1);

void Func()
{
  static datetime PrevTime = 0;
  
  const datetime time = TimeTradeServer();
  
  if (time < PrevTime)
    DebugBreak(); // Срабатывает
  
  PrevTime = time;
}

void OnTick()
{
  Func();
}

void OnTimer()
{
  Func();
}

Server time runs forward and then comes back. It happens on real trade server, but I managed to create playback on custom symbol.


Run

sinput datetime inDateFrom = D'2020.01.01';

void OnStart()
{
  const string Name = "TEMP12345";                                                           // Имя кастомного символа
  const string SymbOrig = "EURUSD";                                                          // Имя оригинального символа

  MqlTick Ticks[];
  
  const int Size = CopyTicksRange(SymbOrig, Ticks, COPY_TICKS_ALL, (long)inDateFrom * 1000); // Считали EURUSD-тики.
    
  if ((Size > 0) && CustomSymbolCreate(Name, NULL, SymbOrig) && SymbolSelect(Name, true))    // Создали символ на основе EURUSD.
  {
    CustomTicksReplace(Name, 0, LONG_MAX, Ticks);                                            // Поместили в него историю EURUSD.        
    
    CustomRatesDelete(Name, D'2020.01.03 23:00', D'2020.01.04 00:00');                       // Удалили несколько баров.
  }
}


A symbol with tick history will be created, but with several bars deleted. Then we start debugging the EA above in this mode.

[Tester]
Symbol=TEMP12345
Period=M1
Optimization=0
Model=4
FromDate=2020.01.01
ToDate=2020.01.08
ForwardMode=0
Deposit=100000
Currency=USD
ProfitInPips=1
Leverage=100
ExecutionMode=0
OptimizationCriterion=6


It stops.

We can see that the time has gone a second time loop.

Search string: Oshibka 002.

 

Forum on trading, automated trading systems and trading strategy testing

MetaTrader 5 Strategy Tester: bugs, bugs, suggestions for improvement

fxsaber, 2020.02.01 13:43

Even this EA is more than twice as slow as Virtual in pips mode.

input int inFakeRange = 0;
sinput int inOffset = 10000;

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

#define  Ask SymbolInfoDouble(_Symbol, SYMBOL_ASK)

void OnTick()
{
  static long Ticket = -1;
  
  if (Ticket == -1)
    Ticket = OrderSend(_Symbol, OP_BUYLIMIT, 1, Ask - inOffset * _Point, 0, 0, 0);
}

Why does this happen? The entire Expert Advisor is on the first tick by setting BuyLimit. Nothing else!

Search string: Uluchshenie 003.
 
Cool!
2020.02.18 13:24:06.618 Core 1  pass 0 returned result 0 in 0:00:05.288 + history synchronization 0:00:03.098
 

It is not possible to set the tick size to less than or equal to one.

If you prescribe and then enter again, the value is zero. For values greater than one, all is fine.

Search string: Uluchshenie 004.

Reason: