Find second strongest value from array
ArraySort() will help you to find them
int arr[] = {1, 2, 3, 4, 5}; ArraySort(arr, WHOLE_ARRAY, 0, MODE_DESCEND); Print("second highest ", arr[1]);
I am also having a similar problem. any help. A more detailed help
Sincere thanks!
ArraySort() will definitely sort the values. But you might need to identify which symbol the value is associated with?
So you could use a two dimensional array to store some kind of symbol id as well...
Something like this
double myarray[28,2]; // value, symbolid myarray[0,0]=USDStrength; myarray[0,1]=USDSymId; myarray[1,0]=EURStrength; myarray[1,1]=EURSymId; // etc
Then, ArraySort() as suggested, which only sorts on the first array element, which you would make the strength value.
How to find second max/min value from array? (first down from strongest valute)
This is my code for max/min values:
int num_array1[8];
int weakvalute=ArrayMinimum(num_array1,WHOLE_ARRAY,0);
I need:
int second_strongvalute?
int second_weakevalute?