【VolatilityExVal】
[code]Inputs: NumberDays(Numeric);Variables: var0(0), var1(0), var2(0), var3(0), var4(0), var5(0);
If DataCompression = 2 Then Begin
var4 = NumberDays;
For var2 = 0 To var4 Begin
var0 = Close[var2];
If var0 = 0 Then
var3 = 1;
End;
If var3 = 0 Then Begin
var5 = SquareRoot(253 / var4);
var1 = ((.6 * Log((Highest(Close, var4) / Lowest(Close, var4))) * var5) + (.6 * Log((Highest(High, var4) / Lowest(Low, var4))) * var5)) * .5;
If var1 <= 0 Then
var1 = 0;
If var1 >= 2.99 Then
var1 = 2.99;
End;
End;
VolatilityExVal = var1
[/code]
页:
[1]