Trade tab sorting order

 
From within a script is it possible to determine if the list of orders is in ascending or descending order?
Reason: