【TrimMeanArray】
[code]inputs:PriceValueArray[ MaxSize ]( numericarrayref ),
Size( numericsimple ),
TrimPct( numericsimple ) ;
variables:
var0( 0 ),
var1( 0 ) ;
var0 = IntPortion( Size * TrimPct * .5 ) ;
condition1 = var0 > 0 and var0 < Size * .5 ;
if condition1 then
begin
Value1 = SortArray( PriceValueArray, Size, -1 ) ;
var1 = 0 ;
for Value2 = 1 + var0 to Size - var0
begin
var1 = var1 + PriceValueArray[Value2] ;
end ;
TrimMeanArray = var1 / ( Size - 2 * var0 ) ;
end
else
TrimMeanArray = -1 ;
[/code]
页:
[1]