Sorting of A Set of Variable Values

 

Hi, 

I'm new to MT4 programming.
I have a set of variables (of prices) that are from custom indicators which I have placed into the following variables as per the code below.

      CurrentPrice = Bid;
      Resistance3 = NormalizeDouble(ObjectGet("R1",1),2);
      Resistance2 = NormalizeDouble(ObjectGet("R2",1),2);    
      Resistance1 = NormalizeDouble(ObjectGet("R3",1),2);     
      Support1 = NormalizeDouble(ObjectGet("S1",1),2);
      Support2 = NormalizeDouble(ObjectGet("S2",1),2);    
      Support3 = NormalizeDouble(ObjectGet("S3",1),2);    
      Pivot1 = ObjectGet("_utL1",1);
      Pivot2 = ObjectGet("_utL2",1);    
      Opening = ObjectGet("_utOP line",1); 


I then want to have these set of values sent via email as the content below:


Current Price: 2387.89
Resistance 3: 2391.02
Resistance 2: 2363.32
Resistance 1: 2335.63
Pivot 1: 2352.57
Opening: 2307.93
Pivot 2: 2258.62
Support 1: 2280.23
Support 2: 2252.54
Support 3: 2224.84


What I would like to do is to be able to sort these set of prices in descending order and should look like as follows:

Resistance 3: 2391.02
Current Price: 2387.89
Resistance 2: 2363.32
Pivot 1: 2352.57
Resistance 1: 2335.63
Opening: 2307.93
Support 1: 2280.23
Pivot 2: 2258.62
Support 2: 2252.54
Support 3: 2224.84


How can I do the sorting? 









 
Put the variables into an array and sort it.
 
William Roeder:
Put the variables into an array and sort it.

Can I add string value into the array?

The array will be a 10 x 2, can the following be done?

[Current Price][2387.89]
[Resistance 3][2391.02
............................