【Skew】
[code]inputs:PriceValue( numericseries ),
Len( numericsimple ) ;
variables:
var0( 0 ),
var1( 0 ),
var2( 0 ),
var3( 0 ) ;
Skew = 0 ;
if Len > 2 then
begin
var0 = Average( PriceValue, Len ) ;
var1 = StandardDev( PriceValue, Len, 2 ) ;
if var1 > 0 then
begin
var2 = 0 ;
for Value1 = 0 to Len - 1
begin
var2 = var2 + Power( ( PriceValue[Value1] - var0 ) / var1, 3 ) ;
end ;
var3 = Len / ( ( Len - 1 ) * ( Len - 2 ) ) ;
Skew = var3 * var2 ;
end ;
end ;
[/code]
页:
[1]