Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 820
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
hello! please help how to write in RSI alert, push notifications tried it myself it does not work gives an error
What is the reason for not playing audio if PlaySound() returns true?
What is the reason for audio not playing if PlaySound() returns true?
The names are correct. The reason turned out to be the alerts. MANY THANKS! It's been a few days since I could figure out what the reason is.
How does ArrayMaximum() function work which is included into the compiler by default? So, the crux of the question is this: this function finds the maximum value in the array, I think that if the array contains values in a chaotic order, in order to find the maximum or minimum value, these values should first be sorted and only then can you choose the maximum value, which will be at the end or at the beginning of the list of the sorted array, how will this function find the maximum value if they are written in a chaotic order?
There is no need to sort anything. The ArrayMaximum() function finds the maximum value in the unsorted array and returns the index of the valuefound .
There is no need to sort anything. The ArrayMaximum() function finds the maximum value in an unsorted array and returns the index of the valuefound .
But it still needs to be lined up in some chain to compare it with one or another value, if there are 5 values and they are written in a chaotic order, the only way to find the maximum or minimum is to compare them all, in any case you need a buffer to store values.
But it still needs to be lined up in a chain to be compared to this or that value, if there are 5 values and they are written in a chaotic order, the only way to find the maximum or minimum is to compare them all, in any case you need a buffer to store the values.
Why try to figure out how it works internally? Well, if you want to write your own function, it's probably more convenient to sort and take the value of one of the outermost indexes. But it will hardly work faster than the built-in function. Plus, the built-in function allows you to search for a value within the designated index limits. So, simple sorting will not work. So, we will have to copy part of the array into an intermediate array and sort it already and take the required value from it, but array copying is not a very "cheap" function.