PureBytes Links
Trading Reference Links
|
Re: Chande's Adaptive Stochastic Oscillator on page 10 of the S&C July
issue.
>...I'm open to any other ideas???
Ok, then here's my interpertation, but I can't say for certain that it's
right. Looks like it could stand to be smoothed, so in the second
verision (at bottom), it is. By the way, I went ahead and added an
input for the volatility lookback period.
Ken
n:=Input("**Volatility** lookback length",1,50,20);
lenmax:=28;
lenmin:=7;
v1:=Stdev(C,n);
v2:=HHV(v1,n);
v3:=LLV(v1,n);
v4:=((v1-v3)/(v2-v3));
currlen:=(Int(lenmin+(lenmax-lenmin)*(1-v4)));
hh:=HHV(H,LastValue(currlen));
ll:=LLV(L,LastValue(currlen));
RawStoch:=((C-ll)/(hh-ll))*100;
stochma:=(.5*RawStoch)+(.5*PREV);
20;
80;
stochma;
RawStoch;
==================
{Smoothed version}
n:=Input("**Volatility** lookback length",1,50,20);
x:=Input("%K smoothing (exponential smoothing)",1,50,3);
y:=Input("%D smoothing (exponential smoothing)",1,50,3);
lenmax:=28;
lenmin:=7;
v1:=Stdev(C,n);
v2:=HHV(v1,n);
v3:=LLV(v1,n);
v4:=((v1-v3)/(v2-v3));
currlen:=(Int(lenmin+(lenmax-lenmin)*(1-v4)));
hh:=HHV(H,LastValue(currlen));
ll:=LLV(L,LastValue(currlen));
RawStochK:=((C-ll)/(hh-ll))*100;
SmoothedStochK:=Mov(RawStochK,x,E);
StochD:=Mov(SmoothedStochK,y,E);
20;
80;
StochD;
SmoothedStochK;
|