TrimMeanArray (Function)
The TrimMeanArray function calculates the mean value of the specified array after trimming away a percentage of values at each end of the array.
Syntax
TrimMeanArray(PriceArray, Size, TrimPct)
Returns (Double)
A numeric value containing the mean of the interior of the array. If TrimPct is less than 0, or TrimPct is greater than 1, then the Function will return a -1.
Parameters
|
Name |
Type |
Description |
|
PriceArray |
Numeric Array |
Specifies the name of a numeric array containing bar values used to calculate the TrimMean value. |
|
Size |
Numeric |
Sets the number of data elements (size) in the array to evaluate. |
|
TrimPct |
Numeric |
Sets the percentage of data to be excluded from both ends of an array (enter .25 for 25%). |
Remarks
TrimMeanArray calculates the mean taken by excluding a percentage "TrimPct" of data points from the extreme tails of the array. This function can be used to exclude outlying data from your analysis.
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 TrimMeanArray function only works with one-dimensional arrays. All array-based referencing begins with array element 1.
Example
The following assigns the lowest value of the 20 elements in the array to Value1:
Array: myArray[20](0);
{… add EL statements here to assign values to array elements... }
Value1 = TrimMeanArray(MyArray, 20);