[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: StdDevx-Function?



PureBytes Links

Trading Reference Links

inputs : Price(NumericSeries),Length(NumericSimple);
vars    : SumSqr(0),Avg(0),Counter(0);

if Length <> 0 
then begin
 Avg = Average(Price,Length);
 SumSqr = 0;
 for counter = 0 to Length - 1 
 begin
  SumSqr = SumSqr + (Price[counter]-Avg) * (Price[counter]-Avg);
 end;
 StdDevX = SquareRoot(SumSqr / (Length-1));
end
else 
 StdDevX = 0;