Placing variables in series by value

 

I have created an indicator where there are 4 extern values: MAE1, MAE2, MAE3, MAE4

Is there a function  to place these in numerical order from lowest to highest so that MA1 contains the lowest MAE1-4, MA2 contains the next lowest, etc?

Seems that the code to do that by hand would be rather intense.

 
gnovak:

I have created an indicator where there are 4 extern values: MAE1, MAE2, MAE3, MAE4

Is there a function  to place these in numerical order from lowest to highest so that MA1 contains the lowest MAE1-4, MA2 contains the next lowest, etc?

Seems that the code to do that by hand would be rather intense.

You could copy the values to an array,  sort the array and copy the values back.
 
RaptorUK:
You could copy the values to an array,  sort the array and copy the values back.


Thanks RaptorUK. I thought perhaps I was perhaps missing a function like MAX(value1, value2, value3...).


I'll use ArraySort() and take your advice -


I really appreciate it!

Reason: