ARRAY SORT indexes

To add comments, please log in or register
Stanislav Ivanov
6607
Stanislav Ivanov  

Hi Guys,

I have a question, and I cant quite find the answer. When I sort an array,for example ascending, do indexes keep or they rearrange?

Thank you in advance !

Amir Yacoby
1335
Amir Yacoby  
Stanislav Ivanov:

Hi Guys,

I have a question, and I cant quite find the answer. When I sort an array,for example ascending, do indexes keep or they rearrange?

Thank you in advance !

Why don't you try?
Array is a data structure that stores a group of elements where each element is accessed directly by its index.
For fast access, the array is stored as a series in the memory, and so the index of each element is translated to its memory address:

Arr[i]=addr(Arr[0]+i*Len(Arr[0]) -

Sort changes the order of the elements in the memory.
Stanislav Ivanov
6607
Stanislav Ivanov  

And out of interest how can it be done in mql4

Thank you

Amir Yacoby
1335
Amir Yacoby  
Stanislav Ivanov:

And out of interest how can it be done in mql4

Thank you

ArraySort()
ArraySort - Array Functions - MQL4 Reference
ArraySort - Array Functions - MQL4 Reference
  • docs.mql4.com
//| Script program start function                                    |
To add comments, please log in or register