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

[EquisMetaStock Group] Bell distribution - ROC bar example



PureBytes Links

Trading Reference Links

Hi,
this little code use the last 14 bars to show bell distribution of ROC
bars.
Thanks Jose for shortcuts and improvment...

Regards,
maurizio


======================
ROC - bar distribution
======================
---8<-----------------

{ ****** (c) Maurizio Neri - 03/2004 ****** }
{ maurizio.neri@xxxxxx }
{ Distribuzione Empirica per Metastock v1.1 }

pds:=Input("ROC periods",1,252,1);

{ calculate current dt, min, max }
Rc:=ROC(C,pds,%);
Kh:=Highest(Rc);
Kl:=Lowest(Rc);

{ Counting and assignment "loop" dt+}
B:=Kh/7;
X:=1;
S1:=100*Cum(Rc>=(Kh-X*B))/Cum(1);
X:=X+1;
S2:=100*Cum(Rc>=(Kh-X*B) AND Rc<(Kh-(X-1)*B))/Cum(1);
X:=X+1;
S3:=100*Cum(Rc>=(Kh-X*B) AND Rc<(Kh-(X-1)*B))/Cum(1);
X:=X+1;
S4:=100*Cum(Rc>=(Kh-X*B) AND Rc<(Kh-(X-1)*B))/Cum(1);
X:=X+1;
S5:=100*Cum(Rc>=(Kh-X*B) AND Rc<(Kh-(X-1)*B))/Cum(1);
X:=X+1;
S6:=100*Cum(Rc>=(Kh-X*B) AND Rc<(Kh-(X-1)*B))/Cum(1);
X:=X+1;
S7:=100*Cum(Rc>=(Kh-X*B) AND Rc<(Kh-(X-1)*B))/Cum(1);

{ Counting and assignment "loop" dt- }
B:=Abs(Kl/7);
X:=1;
S8:=100*Cum(Rc>=(0-X*B) AND Rc<(0-(X-1)*B))/Cum(1);
X:=X+1;
S9:=100*Cum(Rc>=(0-X*B) AND Rc<(0-(X-1)*B))/Cum(1);
X:=X+1;
S10:=100*Cum(Rc>=(0-X*B) AND Rc<(0-(X-1)*B))/Cum(1);
X:=X+1;
S11:=100*Cum(Rc>=(0-X*B) AND Rc<(0-(X-1)*B))/Cum(1);
X:=X+1;
S12:=100*Cum(Rc>=(0-X*B) AND Rc<(0-(X-1)*B))/Cum(1);
X:=X+1;
S13:=100*Cum(Rc>=(0-X*B) AND Rc<(0-(X-1)*B))/Cum(1);
X:=X+1;
S14:=100*Cum(Rc<(0-(X-1)*B))/Cum(1);

{ Restrict plots to last 14 bars }
X:=14-(Cum(1)-ValueWhen(1,Ref(Cum(1),-1)+14
 =LastValue(Cum(1)),Cum(1)));

If(X=1,S1, If(X=2,S2, If(X=3,S3, If(X=4,S4,
 If(X=5,S5, If(X=6,S6, If(X=7,S7,0)))))));

If(X=8,S8, If(X=9,S9, If(X=10,S10, If(X=11,S11,
 If(X=12,S12, If(X=13,S13, If(X=14,S14,0)))))));

Kh;Kl;Kh/7;Kl/7






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
     equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/