- sets the columns which will be used for sorting in AA window

Exploration / Indicators
(AmiBroker 4.90)

SYNTAX SetSortColumns( col1, col2, .... )
FUNCTION sets the columns which will be used for sorting. col1, col2, ... col10 -Column numbers are ONE-based. Positive number means sort ASCENDING, negative number means sort DESCENDING. Upto 10 columns can be specified for multiple-column sort. Each subsequent call to SetSortColumns overwrites previous one, but multiple SetSortColumns make sense if you want to add multiple rankings by different columns via AddRankColumn
EXAMPLE // sort by 5th column in ascending order
SetSortColumns( 5 )

// sort by 3rd column in descending order
SetSortColumns( -3 )

// sort by 1st column in ascending order AND then by Second column in descending order (multiple-column sort).
SetSortColumns( 1, -2 );
SEE ALSO AddRankColumn() function


The SetSortColumns function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.