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

 
fxsaber:

1. Unzip the archive into the empty Terminal folder.


2. Run the script fxsaber\CreateSymbol.ex5.


In a few seconds the chart of the custom symbol will appear.


2. open Tester (CTRL+R) and select the marked setting.



3. Click Start in the appeared Tester window.



4. When the first Optimization results are available press Stop.


5. Change the start date of the interval to 2019.11.01 in the Tester Settings and press Start.


6. Delirious values in Optimization results (from the source, you can see that they cannot differ from each other by more than 50).


Repeated these steps repeatedly. 100% reproduced the problem. Who will try it, let me know.

I will try.

You in turn try with the ticks I tried to reproduce with. MetaQuotes-Demo server

1. Created a custom symbol based on CHFJPY from the terminal dialog (changed only the name)

2. exported CHFJPY ticks for several years into csv-file

3. imported these ticks into CHFJPY.custom

4. Ran your Expert Advisor for genetic optimization. In different combinations

 
Slava:

You in turn try with the ticks I tried to reproduce with. MetaQuotes-Demo server

Reproduced. With this range of inputs.


The results should not differ by more than 50 from each other.


Sort in ascending order, then compare the highest and lowest lines.


SZZ Repeated steps 3-6 from here. With the same dates.

 

Tried the original CHFJPY on MQ-Demo. Played it!

  1. Set the time interval and started GA.
  2. When first few results from all Agents come, I press Stop.
  3. If I don't get any results, I go to step 1, changing time frame (only the start date).
Three attempts and this is the result.

2020.02.21 08:38:14.104 Core 5  genetic pass (0, 252) returned result 965118462.000000 in 0:00:01.114
2020.02.21 08:38:14.114 Core 2  genetic pass (0, 111) returned result 686545176.000000 in 0:00:00.999
2020.02.21 08:38:14.114 Core 2  genetic pass (0, 112) returned result 686545168.000000 in 0:00:01.011
2020.02.21 08:38:14.332 Core 4  genetic pass (0, 76) returned result 1953417341.000000 in 0:00:01.342
2020.02.21 08:38:14.332 Core 8  genetic pass (0, 181) returned result 2212155593.000000 in 0:00:01.419
2020.02.21 08:38:14.395 Core 3  genetic pass (0, 146) returned result 1326263652.000000 in 0:00:01.154
2020.02.21 08:38:14.871 Core 1  genetic pass (0, 2) returned result 1143628048.000000 in 0:00:01.324
 
fxsaber:

Tried the original CHFJPY on MQ-Demo. Played it!

  1. Set the time interval and started GA.
  2. When first few results from all Agents come, I press Stop.
  3. If I don't get any results, I go to step 1, changing timeframe (start date only).
Three attempts and this is the result.

Doing the same thing. It doesn't reproduce.

Let's have some tester agent logs!

 
Slava:

Doing the same thing. It's not playing.

Give me the logs of the tester agents!

Attached all the logs.

Files:
TesterLogs.zip  56 kb
 
fxsaber:

I have attached all the logs.

You reproduced the problem on a regular forex CHFJPY, not even a custom one
 
Slava:
You reproduced the problem on a regular forex CHFJPY, not even a custom one

Yes, on a regular one. Got curious about the ticks in the passes there, so I added some lines to the EA.

// Критерий оптимизации - сумма входных параметров + сумма нецелых частей секунды каждого тика (в миллисекундах).

input int inFakeRange1 = 0;
input int inFakeRange2 = 0;
input int inFakeRange3 = 0;
input int inFakeRange4 = 0;
input int inFakeRange5 = 0;

long Sum = inFakeRange1 + inFakeRange2 + inFakeRange3 + inFakeRange4 + inFakeRange5;

MqlTick Ticks[1000];
int Count = 0;

void OnTick()
{
  MqlTick Tick;

  if (SymbolInfoTick(_Symbol, Tick))
  {
    Sum += Tick.time_msc % 1000;
    
    if (MQLInfoInteger(MQL_TESTER) && (Count < ArraySize(Ticks))) // Запоминаем тики
      Ticks[Count++] = Tick;
  }
}

double OnTester()
{
  FrameAdd(__FILE__, Count, Sum, Ticks); // Отправляем тики через фрейм
  
  return((double)Sum);
}

void OnTesterPass( void )
{
  ulong Pass;
  string Name;
  long id;
  double Value;  

  MqlTick Ticks2[];
  
  while (FrameNext(Pass, Name, id, Value, Ticks2)) // Принимаем фрейм-тики
  {
    FileSave(__FILE__ + "\\" + (string)Pass + ".bin", Ticks2); // Сохраняем на диск
    
    Print((string)Pass + " - " + (string)Value);
  }
}


Then I took two files and compared them using the script.

#include <TypeToBytes.mqh> // https://www.mql5.com/ru/code/16280

void OnStart()
{
  MqlTick Ticks1[];
  MqlTick Ticks2[];
  
  const int Size = (int)MathMin(FileLoad("88021.bin", Ticks1), FileLoad("11921.bin", Ticks2)); // Считали тики из файлов.
  
  int Count = 0;
  
  for (int i = 0; (i < Size) && (Count < 10); i++)
    if (_R(Ticks1[i]) != Ticks2[i]) // Если тики отличаются, выводим их значения.
    {
      Print(i);
      
      ArrayPrint(Ticks1, _Digits, NULL, i, 1);
      ArrayPrint(Ticks2, _Digits, NULL, i, 1);
      
      Print("------------");
      
      Count++;
    }
}


Result.

0
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.08.28 23:27:03 108.10400 108.12500 0.0000        0 1567034823177     134       0.00000
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.10.11 21:21:11 108.71800 108.74100 0.0000        0 1570828871198       4       0.00000
------------
1
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.08.28 23:27:03 108.10400 108.12500 0.0000        0 1567034823177     134       0.00000
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.10.11 21:21:11 108.71800 108.74100 0.0000        0 1570828871198       4       0.00000
------------
2
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.08.28 23:27:03 108.10400 108.12500 0.0000        0 1567034823177     134       0.00000
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.10.11 21:21:11 108.71800 108.74100 0.0000        0 1570828871198       4       0.00000
------------
3
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.08.28 23:27:03 108.10400 108.12500 0.0000        0 1567034823177     134       0.00000
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.10.11 21:21:11 108.71800 108.74100 0.0000        0 1570828871198       4       0.00000
------------
4
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.08.28 23:27:03 108.10400 108.12500 0.0000        0 1567034823177     134       0.00000
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.10.11 21:21:11 108.71800 108.74100 0.0000        0 1570828871198       4       0.00000
------------
5
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.08.28 23:27:03 108.10400 108.12500 0.0000        0 1567034823177     134       0.00000
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.10.11 21:21:11 108.71800 108.74100 0.0000        0 1570828871198       4       0.00000
------------
6
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.08.28 23:27:03 108.10400 108.12500 0.0000        0 1567034823177     134       0.00000
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.10.11 21:21:11 108.71800 108.74100 0.0000        0 1570828871198       4       0.00000
------------
7
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.08.28 23:27:03 108.10400 108.12500 0.0000        0 1567034823177     134       0.00000
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.10.11 21:21:11 108.71800 108.74100 0.0000        0 1570828871198       4       0.00000
------------
8
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.08.28 23:27:03 108.10400 108.12500 0.0000        0 1567034823177     134       0.00000
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.10.11 21:21:11 108.71800 108.74100 0.0000        0 1570828871198       4       0.00000
------------
9
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.08.28 23:27:03 108.10400 108.12500 0.0000        0 1567034823177     134       0.00000
                 [time]     [bid]     [ask] [last] [volume]    [time_msc] [flags] [volume_real]
[0] 2019.10.11 21:21:11 108.71800 108.74100 0.0000        0 1570828871198       4       0.00000


The optimization was performed from 2019.06.01. In the results it is clearly seen that the first ticks are from a different date. And these dates are different from each other.


ZS Did an extra check. The recorded ticks in each delirium pass do not change: the first tick equals the last one. In general, GA passes follow some strange sequence of ticks.

 
fxsaber:

In general, GA passes follow some strange tick sequences.

Reproduced in full brute force mode. The problem affects all Optimize modes.

 
fxsaber:

Yes, on a regular one. Got curious about the ticks in the passes there, so I added some lines to the EA.


Then I took two files and compared them through the script.


Result.


The optimization was performed from 2019.06.01. In the results it is clearly seen that the first ticks are from a different date. And these dates are different from each other.

Does the effect only appear when completing the previous optimisation ahead of time from the "Stop" button? Or with normal termination as well?
 
Slava:
Does the effect occur only when completing the previous optimization early from the "Stop" button? Or with normal termination as well?

Before pressing Stop, I see in the logs and in the Optimization table that erroneous passes have already been counted. Then I press Stop, because there is no point in continuing.

I misunderstood the question.

Yes, as a rule, you should press Stop at least once on the previous Optimization. But as soon as you hit an erroneous Optimization, all following ones become erroneous as well (I don't change the time interval anymore).


Perhaps someone will connect to the replay. Strange that it does not work for you, but for me on a clean Terminal plays quickly.


ZS It would be good to have some kind of closed beta with maximum logging on Agents side. Then the logs on my machine may have localised the problem.

Reason: