NthLowestArray (Function)
The NthLowestArray function will return the lowest, second lowest, third lowest, and so on array element, based on the input N.
Syntax
NthLowestArray(PriceArray, Size, N)
Returns (Double)
A numeric value containing the āNāth lowest occurrence of the specified array. If N is greater than the declared array size or the Size input, or it is less than zero, the function will return a -1.
Parameters
Name |
Type |
Description |
PriceArray |
Numeric Array |
Specifies the name of a numeric array containing bar values to compare for the lowest extremes. |
Size |
Numeric |
Sets the number of data elements (size) in the array to evaluate. |
N |
Numeric |
Sets which value to search for (that is, 1 = lowest, 2 = 2nd lowest, and so on). |
Remarks
Just like the LowestArray function the NthLowestArray function is based on an array. In addition, it also has the input N. This is the input that specifies whether the first, second, third, and so on lowest value desired.
The value for the Size input parameter should always be a whole number greater than 0 and is typically equal to the number of data elements in the array.
The NthLowestArray function only works with one-dimensional arrays. All array-based referencing begins with array element 1.
Example
Assigns to Value2 the 2nd lowest Close in the specified named array myArray with 20 elements.
Array: myArray[20](0);
{⦠add EL statements here to assign Close values to array elements... }
Value1 = NthLowestArray (myArray, 20, 2);