Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1444

 
Aleksandr Slavskii #:

What could be wrong

Set - the string in which we are searching.

txt - what we are looking for.

why aaa = -1 ???

Hello, Alexander! Maybe you should have set the data type to string instead of int? You are looking for text, not a number.

Regards, Vladimir.

 
MrBrooklin #:

Hello, Alexander! Maybe the data type should have been set to string instead of int? I think you are looking for text, not a number.

Regards, Vladimir.

On the picture you can see that the StringFind function returns data with the string type , the int type , namely the number of position from which the searched string starts.

In this case, the function should have returned zero.

 
Aleksandr Slavskii #:

What could be wrong

Set - the string in which we are searching.

txt - what we are looking for.

why aaa = -1 ???

And why the debugger counted 7 characters in txt when there should be 6? And in Set it's supposed to be 26.

 
Aleksandr Slavskii #:

The picture shows that the StringFind function returns data with the string type , the int type , namely the number of position from which the searched string starts.

In this case the function should have returned zero.

I see. Thank you for the clarification. Now I have learnt a new function for me.

Regards, Vladimir.

 
Alexey Viktorov #:

Why debugger counted 7 characters in txt if it should be 6? And in Set as it should be 26

Yes, yes, and this is also strange, thanks, what is wrong here, I started to check the question Yuriy Bykov, I copied from the debugger and pasted into the code, I got this picture.

 "
 RiskMM" (length: 7)        
 "RiskMM=0.3/0.3/0.3/0.3/0.3" (length: 26)

I got the hyphenation to another line from somewhere.

Thank you all for your help. I will look into it.

Yuriy Bykov
Yuriy Bykov
  • 2023.01.13
  • www.mql5.com
Профиль трейдера
 

Can't the highlighted in yellow have that effect? I am clarifying for the purpose of self-study.

StringFind

Поиск подстроки в строке.

int  StringFind(
   string  string_value,        // строка, в которой ищем
   string  match_substring,     // что ищем
   int     start_pos=0          // с какой позиции начинать поиск
   );

Параметры

string_value

[in]  Строка, в которой производится поиск.

match_substring

[in]  Искомая подстрока.

start_pos=0

[in]  Позиция в строке, с которой должен быть начат поиск.

Возвращаемое значение

Возвращает номер позиции в строке, с которой начинается искомая подстрока, либо -1, если подстрока не найдена.

Regards, Vladimir.

 
MrBrooklin #:

Can't the highlighted in yellow have that effect? Just to clarify for self-study purposes.

Regards, Vladimir.

int start_pos=0 Default value

If you do not specify it when passing it to a function, zero will be substituted.

StringFind(Set, txt);
StringFind(Set, txt, 0);

It is the same.

 
Aleksandr Slavskii #:

int start_pos=0 Default value

If it is not specified when passing it to the function, zero will be substituted.

It is the same.

I understand, Alexander. Now I will know.

Regards, Vladimir.

 
Evgeny Dyuka #:

Is it possible to cancel the output of database connection errors?
For example, the DatabaseOpen() function prints an error every time the database is locked and the function cannot access it.
But this is a normal working situation for me and this problem is processed and solved and if necessary, I will catch and output this error myself.

As a result, the whole log is full of messages about the locked base.

answer the question, please
 
Evgeny Dyuka #:
answer the question, please

I think fxsaber has posted a bootloader and a description of how to use it, but I don't remember where and how.

If I'm not mistaken, you need to put it in the terminal folder C:\Users\username\AppData\Roaming\MetaQuotes\Terminal\E98C5173D8A802F9B8F133E800FDDE2B.

And run the botnick every time before starting the terminal.

The solution is not particularly convenient, but if there is no other, then ...

rem Создали RAM-Drive для Тестера.
imdisk -a -o awe -s 3 G -m Z: -p "/fs:ntfs /q /y /v:MT5Tester"

mkdir z:\Tester
mklink /j Tester z:\Tester

rem Кеш оптимизатора будет сохраняться на диске.
mkdir cache
mklink /j z:\Tester\cache cache

rem Временный RAM-Drive, чтобы на него можно было перенаправить log-папки.
imdisk -a -o awe -s 3 M -m Y: -p "/fs:ntfs /q /y /v:MT5Tester_Logs"

mkdir y:\logs
mklink /j Tester\logs y:\logs

mkdir y:\logs0
mkdir Tester\Agent-127.0.0.1-3000
mklink /j Tester\Agent-127.0.0.1-3000\logs y:\logs0

mkdir y:\logs1
mkdir Tester\Agent-127.0.0.1-3001
mklink /j Tester\Agent-127.0.0.1-3001\logs y:\logs1

mkdir y:\logs2
mkdir Tester\Agent-127.0.0.1-3002
mklink /j Tester\Agent-127.0.0.1-3002\logs y:\logs2

mkdir y:\logs3
mkdir Tester\Agent-127.0.0.1-3003
mklink /j Tester\Agent-127.0.0.1-3003\logs y:\logs3

mkdir y:\logs4
mkdir Tester\Agent-127.0.0.1-3004
mklink /j Tester\Agent-127.0.0.1-3004\logs y:\logs4

mkdir y:\logs5
mkdir Tester\Agent-127.0.0.1-3005
mklink /j Tester\Agent-127.0.0.1-3005\logs y:\logs5

mkdir y:\logs6
mkdir Tester\Agent-127.0.0.1-3006
mklink /j Tester\Agent-127.0.0.1-3006\logs y:\logs6

mkdir y:\logs7
mkdir Tester\Agent-127.0.0.1-3007
mklink /j Tester\Agent-127.0.0.1-3007\logs y:\logs7

mkdir y:\logs8
mkdir Tester\Agent-127.0.0.1-3008
mklink /j Tester\Agent-127.0.0.1-3008\logs y:\logs8

mkdir y:\logs9
mkdir Tester\Agent-127.0.0.1-3009
mklink /j Tester\Agent-127.0.0.1-3009\logs y:\logs9

mkdir y:\logs10
mkdir Tester\Agent-127.0.0.1-3010
mklink /j Tester\Agent-127.0.0.1-3010\logs y:\logs10

mkdir y:\logs11
mkdir Tester\Agent-127.0.0.1-3011
mklink /j Tester\Agent-127.0.0.1-3011\logs y:\logs11

mkdir y:\logs12
mkdir Tester\Agent-127.0.0.1-3012
mklink /j Tester\Agent-127.0.0.1-3012\logs y:\logs12

mkdir y:\logs13
mkdir Tester\Agent-127.0.0.1-3013
mklink /j Tester\Agent-127.0.0.1-3013\logs y:\logs13

mkdir y:\logs14
mkdir Tester\Agent-127.0.0.1-3014
mklink /j Tester\Agent-127.0.0.1-3014\logs y:\logs14

mkdir y:\logs15
mkdir Tester\Agent-127.0.0.1-3015
mklink /j Tester\Agent-127.0.0.1-3015\logs y:\logs15

mkdir y:\logs16
mkdir Tester\Agent-127.0.0.1-3016
mklink /j Tester\Agent-127.0.0.1-3016\logs y:\logs16

mkdir y:\logs17
mkdir Tester\Agent-127.0.0.1-3017
mklink /j Tester\Agent-127.0.0.1-3017\logs y:\logs17

mkdir y:\logs18
mkdir Tester\Agent-127.0.0.1-3018
mklink /j Tester\Agent-127.0.0.1-3018\logs y:\logs18

mkdir y:\logs19
mkdir Tester\Agent-127.0.0.1-3019
mklink /j Tester\Agent-127.0.0.1-3019\logs y:\logs19

mkdir y:\logs20
mkdir Tester\Agent-127.0.0.1-3020
mklink /j Tester\Agent-127.0.0.1-3020\logs y:\logs20

mkdir y:\logs21
mkdir Tester\Agent-127.0.0.1-3021
mklink /j Tester\Agent-127.0.0.1-3021\logs y:\logs21

mkdir y:\logs22
mkdir Tester\Agent-127.0.0.1-3022
mklink /j Tester\Agent-127.0.0.1-3022\logs y:\logs22

mkdir y:\logs23
mkdir Tester\Agent-127.0.0.1-3023
mklink /j Tester\Agent-127.0.0.1-3023\logs y:\logs23

mkdir y:\logs24
mkdir Tester\Agent-127.0.0.1-3024
mklink /j Tester\Agent-127.0.0.1-3024\logs y:\logs24
rem Убили временный RAM-Drive
imdisk -D -m Y:


Shit. First I posted it, and then I saw that the botnik is for banning logs in the tester.

Sorry, I can't help you.

Reason: