Libraries: MultiTester - page 35

 
fxsaber #:

Thank you for your help in testing! Updated MTTester.mqh posted.

Thank you very much for the library

 
MTTester.mqh has been updated again. This time I will tell you what was the struggle with.
#include <fxsaber\Benchmark\Benchmark.mqh>  // https://www.mql5.com/ru/code/31279
#include <fxsaber\MultiTester\MTTester.mqh> // https://www.mql5.com/ru/code/26132

const bool Init = EventSetTimer(3);

void OnTimer()
{
  if (MTTESTER::IsReady()) // If the Start button is ready to be pressed
    Print(_B(MTTESTER::ClickStart(), 1)); // Whether the Start button was pressed and how long it took.
}

This Expert Advisor presses the Start button every three seconds, if it is not Stop. I managed to press it - true, otherwise - false.


Standard situation.

Pressed Start - the calculation started.

Alert: Bench_Stack = 0, 1 <= Time[Test.mq5 9 in OnTimer: MTTESTER::ClickStart()] = 125248 mcs.
true
Alert: Bench_Stack = 0, 1 <= Time[Test.mq5 9 in OnTimer: MTTESTER::ClickStart()] = 123327 mcs.
true

This action takes ~125 ms.


It's not uncommon.

Press Start - either instantaneous calculation is started, or the Tester reports that it cannot perform the calculation (e.g. FromDate >= ToDate).

Alert: MTTester.mqh: Start->Stop - is not detected!
Alert: Bench_Stack = 0, 1 <= Time[Test.mq5 9 in OnTimer: MTTESTER::ClickStart()] = 1001401 mcs.
true
Alert: MTTester.mqh: Start->Stop - is not detected!
Alert: Bench_Stack = 0, 1 <= Time[Test.mq5 9 in OnTimer: MTTESTER::ClickStart()] = 1004102 mcs.
true

This action takes about a second. The library will alerter, but will return true - the button was pressed.


Rare situation.

Start is not pressed. This can be cured only by rebooting the Terminal.

I don't have logs of this situation. It will take <10 seconds to identify such a situation. There will be an alert like this.

problem with Start-button!

Return false - the button was not pressed.

 
Updated MTTester.mqh.
 
fxsaber #:

A rare situation.

Start is not pressed. This can be cured only by rebooting the Terminal.

A remote WinServer machine was continuously making hundreds of single passes without any failures.


As soon as I logged in (RDP) to this machine, the Start button stopped clicking. The cure, as always, is to reboot the Terminal.

It seems that this behaviour has something to do with similar logins to the machine. You can log in via RDP dozens of times - everything works fine. But some login becomes fatal for the Tester.


Those who encounter the Start-bug - pay attention to the relationship between logging in to the machine and the Start button.


ZY Coincidence or not, WinServer offered to check its updates during this logon to the machine.

 

Good library.
Is it possible to specify which *.set file with parameter settings to pass programmatically for the test?

By default only the same settings are used, which is not very convenient.

 
sergego18 #:

Is it possible to specify which *.set file with parameter settings to pass programmatically for the test?

Example.
 
fxsaber #:
Example.

Thank you.
Is it better to pass Settings in a single line with rows separated by \n character.

or an array of rows as in the example?

And is it possible to modify in

MTTester class static method Run

static bool Run( const string ExpertName = NULL,

const string Symb = NULL,

const ENUM_TIMEFRAMES period = PERIOD_CURRENT,

const datetime iBeginTime = 0,

const datetime iEndTime = 0 )

add one parameter string ( or an array of strings ) that specify *.set EA settings?

 
sergego18 #:

Thank you.
Is it better to pass Settings in a single line with rows separated by \n character?

or an array of rows like in the example?

GetSettings is CTRL+C in Tester.

SetSettings is CTRL+V in Tester.

See what data CTRL+C/V works with.


And whether it is possible to modify in

MTTester class static method Run

I don't use this method. It remains as history.


The example shows all MTTESTER methods that are needed.

 
sergego18 #:

Is it possible to specify which *.set file with parameter settings to pass programmatically for the test?

Validate works with full-fledged ini files of the Tester and a reduced version - set-files for the Tester.

If you need to run a lot of ini/set files, Validate does it out of the box. Use.

 
fxsaber #:

Validate works with full-fledged Tester ini-files and a stripped-down version - set-files for Tester.

If you need to run a lot of ini/set-files, Validate does it out of the box. Use.

Thank you.
I found a solution from this comment where the set file is loaded in the required format as a string array.

https://www.mql5.com/ru/forum/318305/page34#comment_51842356

I also replaced

typedef bool (*INITDEINIT)( void );

pointer of callback calls at initialisation and deinitialisation of each run

to the interface

interface InitDeInit {

bool RunInit();

bool RunDeInit();

};

which is implemented in the inheritor

of a class similar to the structure SETTINGS

and so in the RunInit() method.

I load the set file of the required tool.

typedef bool (*INITDEINIT)( void ); - such a pointer does not allow you to know which tool is initialising/deinitialising, so it is better to use a pointer to the interface because pointers to methods are not supported by MQL yet.

With this approach there is no need to modify MTTester::Run method.



Библиотеки: MultiTester - Обновил платформу MetaTrader 5 build 3550 улучшения и исправления Fxsaber.
Библиотеки: MultiTester - Обновил платформу MetaTrader 5 build 3550 улучшения и исправления Fxsaber.
  • 2024.01.21
  • Yuriy Bykov
  • www.mql5.com
You can add this draft function for reading settings from file to string array. автоматическим торговым системам и тестированию торговых стратегий. Validate умеет запускать последовательно много ini-задайний