Stochastics Stochastic % D Slow Per1:=Input("length of stoch",1,100,14); Per2:=Input("length of ma1",1,100,3); Per3:=Input("length of ma2",1,100,3); Mov((Mov((((CLOSE-LLV(L,Per1))/(HHV(H,Per1)-LLV(L,Per1)))*100),Per2,S)),Per3,S) Stochastic % D Per1:=Input("length of stoch",1,100,14); Per2:=Input("length of ma",1,100,3); Mov((((CLOSE-LLV(L,Per1))/(HHV(H,Per1)-LLV(L,Per1)))*100),Per2,S) Stochastic %K Per1:=Input("length of stoch",1,100,14); ((CLOSE - LLV(L,Per1))/(HHV(H,Per1)-LLV(L,Per1)))*100 Forward % D N:=Input("periods",1,100,14); K:=(HHV(Ref(H,-N),N)-C)/(HHV(Ref(H,-N),N)-LLV(Ref(L,-N),N)); D:=Mov(K,3,S); D; Forward %K N:=Input("periods",1,100,14); (HHV(Ref(H,-N),N)-C)/(HHV(Ref(H,-N),N)-LLV(Ref(L,-N),N)) *****Adaptive Chande's Stochastic***** 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); StochD; SmoothedStochK; *****Adaptive Stoch 1***** Prds := 20; LenMin := 7; LenMax := 28; v1 := Stdev(CLOSE, Prds); v2 := HHV(v1, Prds); v3 := LLV(v1, Prds); v4 := If((v2-v3)>0,(v1-v3)/(v2-v3),0); currlen := Int(LenMin + (LenMax - Lenmin)*(1-v4)) ; HH := HHV(HIGH,LastValue(currlen+PREV-PREV)); LL := LLV(LOW, LastValue(currlen+PREV-PREV)); AStoch := If((HH-LL)>0,(CLOSE-LL)/(HH-LL)*100,0); AStochMA := If(Cum(1) < Prds, 0, 0.5 * AStoch + 0.5 * PREV); AStoch; AStochMA *****Adaptive Stoch 2***** Prds := 20; LenMin := 7; LenMax := 28; v1 := Stdev(CLOSE, Prds); v2 := HHV(v1, Prds); v3 := LLV(v1, Prds); v4 := If((v2-v3)>0,(v1-v3)/(v2-v3),0); currlen := Int(LenMin + (LenMax - Lenmin)*(1-v4)) ; Stoch(LastValue(currlen+PREV-PREV),3) *****Adaptive Stoch***** Period:= Input("Period:",1,100,14); StochP:= Int(Period / (Stdev(CLOSE,10)/Stdev(CLOSE,5))); StochC:= Mov(C,3,SIMPLE); StochL:= Mov(L,3,SIMPLE); StochH:= Mov(H,3,SIMPLE); (( StochC - LLV( StochL,LastValue(StochP+PREV-PREV) )) / ( HHV( StochH,LastValue(StochP+PREV-PREV) )- LLV( StochL,LastValue(StochP+PREV-PREV) ) ) ) * 100 *****CCI Stoch***** (Sum(CCI(14)-LLV(CCI(14),5),3)/ Sum(HHV(CCI(14),5)-LLV(CCI(14),5),3))*100 *****Super Stoch***** (Stoch(2,2)+Stoch(3,3)+Stoch(4,4)+Stoch(5,5))/4 *****Stoch w Dynamic Bands***** Per1:=Input("length of Stoch",1,100,14); Per2:=Input("length of smooth",1,100,3); Per3:=Input("length of Signal",1,100,3); A:=Stdev(Stoch((Per1),(Per2)),70); A1:=Mov(Stoch((Per1),(Per2)),70,S); B:=Stoch((Per1),(Per2)); Sig:=Mov(B,Per3,S); UB:=A1+A; LB:=A1-A; UB; LB; Sig; B; *****Stoch DiNapoli Prefered***** FK:=((C - LLV(L,8))/(HHV(H,8) - LLV(L,8)))* 100; FD:=If(Cum(1)+1<(3+2),FK, If(Cum(1)+1=(3+2),Mov(FK, LastValue(3),S),PREV+((1/3)*(FK-PREV)))); STO:=If(Cum(1)+1<(3+2),FD, If(Cum(1)+1=(3+2),Mov(FD, LastValue(3),S),PREV+((1/3)*(FD-PREV)))); STO; *****Stoch DiNapoli***** Per1:=Input("length of stoch",1,100,8); Per2:=Input("length of ma",1,100,3); Per3:=Input("length of ma2",1,100,3); A:= Mov((((CLOSE-LLV(L,Per1))/(HHV(H,Per1)-LLV(L,Per1)))*100),Per2,S); B:=Mov((Mov((((CLOSE-LLV(L,Per1))/(HHV(H,Per1)-LLV(L,Per1)))*100),Per2,S)),Per3,S); A;B;