Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 887

 
There is a text file that contains numbers like:

10962
11433
13226
12232

I need to find the maximum number among these numbers, so I do the following:

//Открываю файл
int file_1 = FileOpen("ch/DOWNLINE.TXT",FILE_TXT|FILE_READ); 

//Читаю все числа в массив
string arr_1[];
FileReadArray(file_1,arr_1,WHOLE_ARRAY);

//Пытаюсь найти максимальное число в массиве
int maximum =  ArrayMaximum(arr_1,WHOLE_ARRAY,0);

However, the ArrayMaximum function fails because arr_1[] is a string array, and I need to convert it to a numeric array. Please help with solving the conversion from a string array to a numeric one.
 
NastyaMaley:
There is a text file that contains numbers of the form:

10962
11433
13226
12232

I need to find the maximum number among these numbers, so I do the following:


However, the ArrayMaximum function fails because arr_1[] is a string array, and I need to convert it to a numeric array. Please help with solving the conversion from a string array to a numeric one.


Convert a string containing a character representation of a number to an int (integer) number.

long  StringToInteger( 
   string  value      // строка 
   );
 
Alekseu Fedotov:


Convert a string containing a character representation of a number to an int (integer) number.

Alekseu Fedotov:


Convert a string containing a character representation of a number to an int (integer) number.

Thanks )

How do I paste this into my code now?

 
Unfortunately, it doesn't work (
 
NastyaMaley:
Unfortunately, it does not work (

Are you doing everything right?


According to the help

FileReadArray Reads arrays of any type, except string arrays

 
How can I share MQL4\include folder between MT4 and MT5? Or any other folder?
 
Hello!Colleagues need help. In the article "How to properly submit a product to the market" there is only 1 EX5-EX4 file?Question? Expert Advisor based on an indicator, calculations in the indicator file in the Expert Advisor function iCustom(2 files), how to submit to the market? Service Desk will not answer for 3 days?
 
Oleg Kolesov:
Hello!Colleagues, I need some help. The article "How to correctly submit a product to the Market" only shows 1 EX5-EX4 file? The Expert Advisor is based on an indicator, the calculations in the indicator file in the Expert Advisor function iCustom(2 files), how to submit to the Market? Service Desk will not answer for 3 days?

You have been answered in the MQL5 questions thread - enable the indicator as a resource, don't know how - start searching for "resource" on the website

https://docs.mql4.com/ru/runtime/resources

Service Desk deals with financial issues, not training
Ресурсы - Программы MQL4 - Справочник MQL4
Ресурсы - Программы MQL4 - Справочник MQL4
  • docs.mql4.com
//| Функция вызывает штатную OrderSend() и проигрывает звук          | В данном примере показано как проигрывать звуки из файлов Ok.wav и timeoit.wav, входящих в стандартную поставку терминала. Эти файлы находятся в папке означает папку, из которой запущен клиентский терминал MetaTrader 4.  Программным путем из mql4-программы каталог...
 
Yes, thank you.
 
How do multicurrency and multi-timeframe panels work in the strategy tester (in terms of getting the necessary data, as it would in normal conditions) for MQL4 and MQL5?