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

[EquisMetaStock Group] Re: Statistical Median



PureBytes Links

Trading Reference Links

> > --- In equismetastock@xxxxxxxxxxxxxxx, "alakbarian" 
> > <azmani_mouhieddine@xxxx> wrote:
> > > how can I build a Statistical Median in Mtastock:
> > > exemple Statistical Median of volume?

Hi, a little contribution but not a final solution... based on my
little indicator written to show "empirical" distribution with MS

Try this code:

{ ****** (c) Maurizio Neri - 04/2004  ****** }
{ maurizio.neri@******                       }
{ Empirical Volume Average for Metastock v1.0}



plot:=Input("Plot type: Vol Distibution[1], VolAvg[2]",1,2,2);

{ Assign Bins Sizing }
B:=Highest(V)/15;
Nb:=Cum(1);

{ Loop to measure empirical distribution}
X:=1;
S1:=100*Cum(V< X*B)/Nb;
X:=X+1;
S2:=100*Cum(V>=X*B AND V<(X+1)*B)/Nb;
X:=X+1;
S3:=100*Cum(V>=X*B AND V<(X+1)*B)/Nb;
X:=X+1;
S4:=100*Cum(V>=X*B AND V<(X+1)*B)/Nb;
X:=X+1;
S5:=100*Cum(V>=X*B AND V<(X+1)*B)/Nb;
X:=X+1;
S6:=100*Cum(V>=X*B AND V<(X+1)*B)/Nb;
X:=X+1;
S7:=100*Cum(V>=X*B AND V<(X+1)*B)/Nb;
X:=X+1;
S8:=100*Cum(V>=X*B AND V<(X+1)*B)/Nb;
X:=X+1;
S9:=100*Cum(V>=X*B AND V<(X+1)*B)/Nb;
X:=X+1;
S10:=100*Cum(V>=X*B AND V<(X+1)*B)/Nb;
X:=X+1;
S11:=100*Cum(V>=X*B AND V<(X+1)*B)/Nb;
X:=X+1;
S12:=100*Cum(V>=X*B AND V<(X+1)*B)/Nb;
X:=X+1;
S13:=100*Cum(V>=X*B AND V<(X+1)*B)/Nb;
X:=X+1;
S14:=100*Cum(V>=X*B AND V<(X+1)*B)/Nb;
X:=X+1;
S15:=100*Cum(V>=X*B AND V<(X+1)*B)/Nb;

{ Restrict evaluation & plots to last 15 bars }
X:=(1+Nb-ValueWhen(1,Ref(Nb,-1)+15=LastValue(Nb),Nb));

{ Assign at each of last 15 bar a "bin" value}
K:=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,
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, If(X=15,S15, 0)))))))))))))));

{Select plot type and go}
If(Plot=1,K, {Volume Distribution}
ValueWhen(1,K=Highest(K),(X+.5)*B){VolAvg Value=>Line});
If(Plot=1,0,If(X>0,X*B,0){Bin slot=> Dotted})


To view a sample chart visit:
http://www.finanzaonline.com/forum/showthread.php?s=&postid=5361564#post5361564

Best regards
maurizio




 
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/