Sorts the series in ascending and descending order. Will sort a limited part of the series any where in the series.
Can only be use only with non-auto indexed series.
Auto Indexed series must always be kept align with their indexing method.
•BPV Auto-Indexed series are aligned with test.currentDay.
•IPV Auto-Indexed series are aligned with instrument.bar.
Syntax: |
---|
SortSeries( seriesName, [element count], [offset], [direction] ) |
Parameter: |
Description: |
---|---|
seriesName |
The series name to be sorted. |
[element count] |
Optional function value. When omitted, the default is to sort all the elements in the series unless a specified number of elements is entered into this field. When a value is entered, that value will specify how many elements to sort. |
[offset] |
Optional function value. When omitted, the default is to sort all the elements in the series.
When a value is entered into the optional "element count" field, the value entered in this field will be the starting index from which element count will use to start the optional "element count" number of elements to sort. This means when the intent is to sort the entire series without any exclusions the value entered into this area should be the same as "element count" value. |
[direction] |
Optional function value. The default, or no entry in this field, is to sort the elements in an ascending order. Note:A positive value sorts the elements in an ascending order. A negative value sorts the elements in a descending order. |
Example - 1: |
---|
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Return - 1: |
Show Series Size Series Size = 3
Unsorted Series WtFactors[1] = 0.300000000 WtFactors[2] = 0.400000000 WtFactors[3] = 0.300000000
Series Sorted in Ascending Order WtFactors[1] = 0.300000000 WtFactors[2] = 0.300000000 WtFactors[3] = 0.400000000
Series Sorted in Descending Order WtFactors[1] = 0.400000000 WtFactors[2] = 0.300000000 WtFactors[3] = 0.300000000 |
Example - 2: |
---|
' Now sort the results series. |
Links: |
---|
See Also: |
Edit Time: 9/18/2020 11:37:15 AM |
Topic ID#: 571 |