Questions from Beginners MQL5 MT5 MetaTrader 5 - page 599

 
Anatolii Zainchkovskii:

Help, an error is popping up in the string

StringTrimLeft( StringSubstr(ResultSymbols,1,StringLen(StringSubstr(ResultSymbols,0,1))- 1))

'ResultSymbols' - undeclared identifier 296 46

unknown variable


 
Hello!

Can you tell me how to start a tester in another terminal using a script from one terminal?

About two years ago it was possible to do it this way:

// ShellExecuteA (работает с параметрами в ANSI),а ShellExecuteW (работает с параметрами в unicode)

#import  "shell32.dll"
    int ShellExecuteW
       ( int    hwnd,                  // Хендл родительского окна. Это окно получает любые окна сообщений, которые генерирует приложение.
         string Operation,             // Указатель на строку, определяющую операцию для выполнения.
         string File,                  // Указатель на строку, определяющую имя файла для открытия или печати, или имя папки для открытия.
         string Parameters,            // Указатель на строку параметров исполнимого файла.
         string Directory,             // Указатель на строку, определяющую директорию по умолчанию.
         int    ShowCmd );             // Определяет как файл будет показываться когда откроется. 3-Активирует окно и отображает его в развернутом виде.
#import

int      Start = 0;                                                          // Значение, возвращаемое функцией ShellExecuteW
string   PuthTester  = "D:\\Alpari_Terminal_Tester";                         // Путь к Тестеру
string   PuthIniTester = "D:\\Alpari_Terminal_Tester\\tester\\optimise.ini"; // Путь к Файлу *.ini в Тестере

int start()
   {
    Start = ShellExecuteW(0, "Open", "terminal.exe", PuthIniTester, PuthTester, 3);
    if(Start==2) Alert("Указаный файл не найден");
    return(0);
   }

What about now?

 
Leo59:
Hello!

Can you tell me how to start a tester in another terminal using a script from one terminal?

About two years ago it was possible to do it this way:


What about now?

Are you a mind reader :) ? I'm just preparing an article about running tests in several modes at once. I hope you are asking about MetaTrader 5 and you have a Windows 10 64 bit operating system?
 
Karputov Vladimir:
Are you a mind reader :) ? I'm just preparing an article about running tests in several modes at once. I hope you are asking about MetaTrader 5 and you have a Windows 10 64 bit operating system?
Vladimir, unfortunately it is MetaTrader 4
 

Previously, as far as I remember, the optimise.ini file was automatically created when running the tester in MetaTrader4. Now this file is not created.

Can you please tell me how to start the tester in another terminal using a script from one terminal?

About two years ago I could do it this way:

// ShellExecuteA (работает с параметрами в ANSI),а ShellExecuteW (работает с параметрами в unicode)

#import  "shell32.dll"
    int ShellExecuteW
       ( int    hwnd,                  // Хендл родительского окна. Это окно получает любые окна сообщений, которые генерирует приложение.
         string Operation,             // Указатель на строку, определяющую операцию для выполнения.
         string File,                  // Указатель на строку, определяющую имя файла для открытия или печати, или имя папки для открытия.
         string Parameters,            // Указатель на строку параметров исполнимого файла.
         string Directory,             // Указатель на строку, определяющую директорию по умолчанию.
         int    ShowCmd );             // Определяет как файл будет показываться когда откроется. 3-Активирует окно и отображает его в развернутом виде.
#import

int      Start = 0;                                                          // Значение, возвращаемое функцией ShellExecuteW
string   PuthTester  = "D:\\Alpari_Terminal_Tester";                         // Путь к Тестеру
string   PuthIniTester = "D:\\Alpari_Terminal_Tester\\tester\\optimise.ini"; // Путь к Файлу *.ini в Тестере
string   PuthIniTerminal = "D:\\Alpari_Terminal\\MQL4\\Files\\optimise.ini"; // Путь к Файлу *.ini в Терминале

int start()
   {
    Start = ShellExecuteW(0, "Open", "terminal.exe", PuthIniTester, PuthTester, 3);
    if(Start==2) Alert("Указаный файл не найден");
    return(0);
   }

How about now ?
 

now creates a file with the name of the expert to be tested

lastparameters.ini

 
Vladislav Andruschenko:

a file is now created with the name of the expert being tested

What do you write the answers for? To give them a tick?


Previously, the optimise.ini file contained

;optimise strategy tester
TestExpert=AB_e_MACD_v36_Test_P
TestSymbol=EURUSD
TestPeriod=1
TestModel=2
TestDateEnable=true
TestFromDate=2014.05.29
TestToDate=2014.05.30
TestShutdownTerminal=true

And where is this now in the file with the name of the tested EA? In what block?

In <common>, <inputs> or in <limits> ?

 

lastparameters.ini - data file of last tester operation.

you can start the test from another terminal without any problems, create an ini file to start the terminal with preset parameters, including EA name, date and so on.

https://www.metatrader4.com/ru/trading-platform/help/service/start_conf_file

 
Vladislav Andruschenko:

lastparameters.ini - data file of last tester operation.

you can start the test from another terminal without any problems, create an ini file to start the terminal with preset parameters, including EA name, date and so on.

https://www.metatrader4.com/ru/trading-platform/help/service/start_conf_file

Thank you, Vladislav. I will be looking into it.
 
Leo59:
Thank you, Vladislav. I will study it.

I used the same principle to make a program Exp - Super Tester - which is available for free on the Internet.

There is the same principle there - the program creates an initialization file, then starts the terminal with this file, respectively conducts a test, makes a report and shuts down - starts the next test and so on.

But that was long ago, then I remember that some parameters were changed and I was redesigning my program.

In your case the principle is the same only you start the tester from another terminal.

Reason: