Errors, bugs, questions - page 2150

 
Vladislav Andruschenko:

Terminal 1755

When working with the Expert Advisor and compiling - its updated version appears on the chart - everything is ok

but in the tester I select this EA and after compilation another (previous) EA is selected.

After restarting - everything is OK.

Ancient problem.

 

A few tester_file-bugs. Playback step by step

  1. Leave one working local Agent and clean the Terminal Sandbox - MQL5\Files\*.*
  2. Compile EA
    #property tester_file __FILE__
    
    sinput uint Range = 100; // Входной параметр для Оптимизации
    
    #define  SETRANGE(A, START, STEP, END) ParameterSetRange(#A, true, A, START, STEP, END)
    
    void OnTesterInit()
    {
      SETRANGE(Range, 0, 1, Range);
      
      const int handle = FileOpen(__FILE__, FILE_WRITE | FILE_BIN );
      
      // Создаем файл на 4 байта
      if (handle != INVALID_HANDLE)
      {
        FileWriteInteger(handle, 0);
        
        FileClose(handle);
      }
    }
    
    void OnTesterDeinit() { ChartClose(); }
    
    #define  TOSTRING(A) #A + " = " + (string)(A) + " "
    
    void OnTesterPass()
    {
      ulong Pass;
      string Name;
      long ID;
      double dOnTester;
      uchar Data[];
    
      while (FrameNext(Pass, Name, ID, dOnTester, Data))
        Print(TOSTRING(Pass) + TOSTRING(ID)); // Распечатываем размер файла на Агенте
    
      return;
    }
    
    double OnTester()
    {
      const int handle = FileOpen(__FILE__, FILE_READ | FILE_WRITE | FILE_BIN );
    
      const int i = (int)((handle != INVALID_HANDLE) ? FileSize(handle) : -1);
      
      // Делаем файл 4 байта, делаем - 8.
      if ((handle != INVALID_HANDLE) && (FileSize(handle) == INT_VALUE))
      {
        FileSeek(handle, 0, SEEK_END);
        FileWriteInteger(handle, 0);
              
        FileClose(handle);
      }
    
      uchar Data[];    
      FrameAdd(NULL, i, 0, Data); // Передаем размер файла до изменений.
      
      return(0);
    }

  3. In doing so, a message will appear in the Tester's log file saying that tester_file does not exist yet
    2018.02.28 08:37:29.574 Moving Average  tester_file 'Moving Average.mq5' is not exist
    2018.02.28 08:37:29.574 Moving Average  tester_file 'Moving Average.mq5' is not exist

  4. Run the Expert Advisor through the opening prices in the Strategy Tester in Complete Brute Force Optimization mode. We will see in the Tester's log
    2018.02.28 21:20:24.424 Statistics      optimization done in 0 minutes 03 seconds
    2018.02.28 21:20:24.424 Statistics      local 101 tasks (100%), remote 0 tasks (0%), cloud 0 tasks (0%)

  5. Immediately restart this same Optimization by pressing "Start". We'll get slower Optimize by 30 times - bug!
    2018.02.28 21:23:02.219 Statistics      optimization done in 1 minutes 06 seconds
    2018.02.28 21:23:02.219 Statistics      local 101 tasks (100%), remote 0 tasks (0%), cloud 0 tasks (0%)


  6. The results of the Frame-advisor will show that the existing file is not transferred, as the compilation process was carried out without it (see step 3). Bug or a bug?
  7. Recompile the Expert Advisor. In this case, we won't receive messages that are shown in p. 3, which is correct.
  8. Restart the Optimization. Frame-Advisor will show that the tester_file has been transferred to the Agent
    2018.02.28 21:28:33.449 Moving Average (EURUSD,M1)      Pass = 0 ID = 4 
    2018.02.28 21:28:33.472 Moving Average (EURUSD,M1)      Pass = 1 ID = 8 
    2018.02.28 21:28:33.495 Moving Average (EURUSD,M1)      Pass = 2 ID = 8 
    2018.02.28 21:28:33.519 Moving Average (EURUSD,M1)      Pass = 3 ID = 8 

  9. Re-run the optimization. We'll get slowdown, as in step 4. But in Frame-mode, we'll see that tester_file wasn't passed to the Optimizer on the second start - bug!
    2018.02.28 21:28:43.727 Moving Average (EURUSD,M1)      Pass = 0 ID = 8 
    2018.02.28 21:28:43.797 Moving Average (EURUSD,M1)      Pass = 1 ID = 8 
    2018.02.28 21:28:43.834 Moving Average (EURUSD,M1)      Pass = 2 ID = 8 
    2018.02.28 21:28:43.864 Moving Average (EURUSD,M1)      Pass = 3 ID = 8 


  10. We will run the third Optimization and obtain the results in step 8.
  11. Fourth, we obtain results in step 9.
  12. So every odd running of Optimization gives you the result of step 8, even numbered optimization gives you the result of step 9.

What the EA does. In frame mode, in OnTesterInit, it creates a 4 bytes file and sends it through the tester_file mechanism to the Agent. The Agent opens it and if it sees that the file size is 4 bytes, it will append it to 8 bytes. The Agent itself passes the original file size in bytes through the frame. Thereby it is checked that the file is transferred on the first pass of Optimizer, and other passes work with the file, that temporarily lies in the Sandbox of Agent itself.

In general, we managed to reproduce a few bugs.

 

this question may have already been asked, but nevertheless:

is it possible to call the indicator parameter window in MQL5?

 

Forum on trading, automated trading systems and trading strategy testing

Discussion on "Cross-platform trading advisor: Introduction"

fxsaber, 2016.08.17 16:51

Cut to the StringConcatenate example. Hard to understand people using this function in MT4/5. Not only is it cumbersome, but it is not even clear. String concatenation has ALWAYS been achieved in both platforms via the + operator. So using StringConcatenate for strings is comparable to using the "NumberSummary" function to get the sum of the numbers. Absurd, in short.

Not only is it absurd, it's also not cross-platform.

 
Andrii Djola:

this question may have already been asked, but nevertheless:

is it possible to call the indicator parameter window in MQL5?

As far as I know, there is no such a function in MQL.
But through WinAPI you can open the list of all indicators, look through indicator tree and find the right one...

 
Andrii Djola:

maybe this question has already been asked, but still:

is it possible to call the indicator parameter window in MQL5?

Service Desk has promised to think about such a function.

 

Why is this happening?

2018.03.01 06:54:04.342 Tester debug version of "MQL5\Experts\MyExpert.ex5" can be optimized on local agents only, no Cloud, no Farm

How do I fix it?


 
Nexxtor:

Why is this happening?

2018.03.01 06:54:04.342 Tester debug version of "MQL5\Experts\MyExpert.ex5" can be optimized on local agents only, no Cloud, no Farm

How do I fix it?


Compile first, then run optimization.

 
In the folder "Bases\MetaQuotes-Demo\history\" a folder with 2018.hcc relating to the custom symbol appeared. Bug.
 

In continuation of this great feature of the Tester. Running Optimization, I get this


Core1 log

KE      0       14:23:25.855    Startup MetaTester 5 x64 build 1755 (18 Jan 2018)
KP      0       14:23:25.862    Server  MetaTester 5 started on 127.0.0.1:3000
OJ      0       14:23:25.862    Startup initialization finished
JQ      0       14:23:25.871    127.0.0.1       login (build 1755)
HG      0       14:23:38.760    Network 38520 bytes of account info loaded
JP      0       14:23:38.760    Network 1482 bytes of tester parameters loaded
QG      0       14:23:38.760    Network 2236 bytes of input parameters loaded
OP      0       14:23:38.771    Network 4605 bytes of symbols list loaded
NK      0       14:23:38.771    Tester  expert file added: Experts\fxsaber\Test.ex5. 115516 bytes loaded
NM      0       14:23:38.771    Network 1368 bytes of optimized inputs info loaded
CH      0       14:23:38.774    Tester  successfully initialized
HL      0       14:23:38.774    Network 118 Kb of total initialization data received
JF      0       14:23:38.775    Tester  Intel Core i7-2700 K  @ 3.50 GHz, 16301 MB
KL      0       14:23:38.775    Tester  optimization pass 0 started (batch of 30 tasks)


Core2 log.

CQ      0       14:25:27.983    Startup MetaTester 5 x64 build 1755 (18 Jan 2018)
MD      0       14:25:27.988    Server  MetaTester 5 started on 127.0.0.1:3001
FO      0       14:25:27.989    Startup initialization finished
FM      0       14:25:29.021    127.0.0.1       login (build 1755)
HK      0       14:25:29.026    Network 38520 bytes of account info loaded
IL      0       14:25:29.026    Network 1482 bytes of tester parameters loaded
RK      0       14:25:29.026    Network 2236 bytes of input parameters loaded
QL      0       14:25:29.029    Network 4605 bytes of symbols list loaded
PG      0       14:25:29.030    Tester  expert file added: Experts\fxsaber\Test.ex5. 115516 bytes loaded
DI      0       14:25:29.030    Network 1368 bytes of optimized inputs info loaded
HL      0       14:25:29.032    Tester  successfully initialized
GP      0       14:25:29.032    Network 118 Kb of total initialization data received
JR      0       14:25:29.032    Tester  Intel Core i7-2700 K  @ 3.50 GHz, 16301 MB
KI      0       14:25:29.033    Tester  optimization pass 180 started (batch of 30 tasks)


All the agents were Ready before the start. There was no visualizer. Core2 (and Core2 - see screenshot) started two minutes after the start. Let's solve the problem!