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

 
Valeriy Yastremskiy:

I don't understand, an array index is an index from 0 to N. And what you want is more like a dictionary with hashes. I don't know how to do this in an array and I don't think it can be done in a regular array. There's a Generic class library with dictionaries in MT. That should help.

Thanks for the valuable information. Everything is clear and straightforward on this point. That is, a strict sequence of index values of any array (necessarily starting with 0) is an inherent property of any array.

If you're not too much trouble, please give me another answer to the following question: .... There is a unsorted one-dimensional array, say, with 10 elements, which are all filled with values. Using the ArraySort(S_L,10,0,MODE_DESCEND) function

this array is sorted in descending order, and after the sorting the order of array element values has drastically changed.

Q. After this array has been sorted, can I use some function to return the array to the state it had before sorting, i.e. the former sequence of values and the former sequence of indices should be.

Thank you.

 
ANDREY:

Thank you for the valuable information. Everything is clear and straightforward on this point. That is, a strict sequence of index values of any array (necessarily starting from 0) is an inherent property of any array.

If you're not too much trouble, please give me another answer to the following question: .... There is a unsorted one-dimensional array, say, with 10 elements, which are all filled with values. Using the ArraySort(S_L,10,0,MODE_DESCEND) function

this array is sorted in descending order, and after the sorting the order of array element values has drastically changed.

Q. After this array has been sorted, can I use some function to return the array to the state it had before sorting, i.e. the former sequence of values and the former sequence of indices should be.

Thank you.

I don't know such a function, in general, in such tasks, a copy of the array is saved, and if you need the original, a copy is used.

Any sorting function is a series of comparative operations and permutations or, correctly, reassignment of array values that are not memorized. Therefore, there is no way to do it without a copy of the original.

And there is no such thing as an index sequence. The sequence of indexes is always the same, from 0 to N in ascending order. We can flip the array, but this is reassigning the value of the Nth element to the zero one and beyond.

 
Valeriy Yastremskiy:

I do not know such a function, in general in such tasks, a copy of the array is stored and if the original is needed, a copy is used.

Any sorting function is a series of comparative operations and permutations or, correctly, reassignment of array values, which are not remembered. Therefore, there is no way to do it without a copy of the original.

And there is no such thing as an index sequence. The sequence of indexes is always the same, from 0 to N in ascending order. We can reverse the array, but it is reassigning the value of the N-th element to the zero one and so on.

I see. Thanks, so I need to copy the array to another array first, and then send the first array to sort.
Thanks again.

 
Ivan_Invanov:
returned values

iok is 2
fok is 1
gtc is 0

Is this correct? Can't there be two policies available?

Yes, it can.

The function in this mode returns policy flags.

 
Ivan_Invanov:

I don't get a lot of replies here, so I'll make a new topic every time.

Because you're asking questions that are covered with examples in the help.

Or do you want me to read them out loud to you?

Документация по MQL5: Константы, перечисления и структуры / Состояние окружения / Информация об инструменте
Документация по MQL5: Константы, перечисления и структуры / Состояние окружения / Информация об инструменте
  • www.mql5.com
Для получения текущей рыночной информации служат функции SymbolInfoInteger(), SymbolInfoDouble() и SymbolInfoString(). В качестве второго параметра этих функций допустимо передавать один из идентификаторов из перечислений ENUM_SYMBOL_INFO_INTEGER, ENUM_SYMBOL_INFO_DOUBLE и ENUM_SYMBOL_INFO_STRING соответственно. Некоторые символы (как правило...
 
Artyom Trishkin:

Because you are asking questions that are covered with examples in the help.

Or should I read them out loud to you?

There was also a question that was not covered in the fact sheet. I realise, of course, that there are a lot of people like me here and you are tired of repeating the same thing. But you could have explained it to the man in more detail than in the fact sheet. But of course this is at your discretion. But again, there was a question that is not reflected in the briefing, whether there is more than one enforcement policy. Is it your responsibility to answer questions that are not on the brief? Is it your responsibility to be rude? Instead of being rude, you can explain more than in the fact sheet. But it is a question of personalities.
 
Ivan_Invanov:
There was also a question that wasn't covered in the help. I understand of course that there are many like me here and you are tired of repeating the same thing. But you could have explained it to the man in more detail than in the fact sheet. But of course this is at your discretion. But again, there was a question that is not reflected in the briefing, whether there is more than one enforcement policy. Is it your responsibility to answer questions that are not on the brief? Is it your responsibility to be rude? Instead of being rude, you can explain more than in the fact sheet. But it is a question of personalities.

You don't even read the forum, not just the documentation.

Here's the answer

ps But here to delete their messages is not decent. Especially if the message has already been quoted.
 
Alexey Viktorov:

You don't even read the forum, not just the documentation.

Here's your answer


This is the answer after the flood, if a person does not think it is necessary to answer a question, let him say so. But he is silent, and then he allows himself to be rude. I understand, of course, corporate solidarity above all.

 
Ivan_Invanov:

It's answer after flooding, if the person doesn't think it's necessary to answer the question, let him say so. But he keeps his mouth shut and then allows himself to be boorish. I understand, of course, corporate solidarity above all.

Ward 6.

Do you think that someone should sit at the monitor and wait for your question? If there is no answer for 3 minutes, that's it? A disaster? You first got an answer and then an explanation of why there is no response. Instead of thanking you, you're being unreasonable. And what does corporate solidarity have to do with it? What corporation are you referring us to?

 
Ivan_Invanov:

It's answer after flooding, if the person doesn't think it's necessary to answer the question, let him say so. But he keeps his mouth shut and then allows himself to be boorish. I understand of course, corporate solidarity above all.

The answers were in the order of your questions.
In your other thread, where another moderator answers you, don't try to talk to him in the same way - it's fraught with danger. That's me being kind...
Reason: