Type : Function, Name : StdDevx
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;
Type : Indicator, Name : Kase Peak Oscillator
inputs:LEN(30), Smooth(3), Strength(1);
vars: RWH(0), RWL(0),PEAK(0), MEAN(0), STD(0);
RWH = (H[0] — L[LEN]) / (AvgTrueRange(LEN) * SquareRoot(LEN));
RWL = (H[LEN] — L[0]) / (AvgTrueRange(LEN) * SquareRoot(LEN));
PEAK = WAverage((RWH — RWL),3);
MEAN = average(PEAK,LEN);
STD = StdDevx(PEAK,LEN);
if (MEAN + (1.33 * STD)) > 2.08 then value1 = (MEAN + (1.33 * STD))
else value1 = 2.08;
if (MEAN — (1.33 * STD)) < -1.92 then value2 = (MEAN — (1.33 * STD))
else value2 = -1.92;
plot1(PEAK,»PeakOsc»);
if PEAK[1] >= 0 and PEAK > 0 then plot2(value1,»+/-97.5%»);
if PEAK[1] <= 0 and PEAK < 0 then plot2(value2,»+/-97.5%»);