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

Re: [Metastockusers] # of consecutive negagive 1 day roc



PureBytes Links

Trading Reference Links

There is a much simpler way to achieve the same thing.
Kaj was kind enough to write to me directly so as not to embarrass me. His
solution is
dd:=C<Ref(C,-1);
BarsSince(dd=0)

I suspected there would be an easier way but sent the code I did because it
has wider use than a simple bar count.

Roy

----- Original Message -----
From: "trend trader" <trend2trader@xxxxxxxxx>
To: <Metastockusers@xxxxxxxxxxxxxxx>
Sent: Saturday, December 07, 2002 10:53 AM
Subject: Re: [Metastockusers] # of consecutive negagive 1 day roc


>
> thanks a lot roy,
>
> working fine
>  Roy Larsen <rlarsen@xxxxxxxxxxxxxx> wrote:Trend2trader
>
> > does anyone know how to programm an indicator which counts the # of
> > consecutive down days?
> >
> > thanks in advance
>
> Try this
>
>   {Signal Counter}
> a:=C<Ref(C,-1); {signal}
> b:=C>=Ref(C,-1) AND Alert((C>=Ref(C,-1))=0,2); {reset}
> i:=Cum(a+b>-1)=1;
> f:=BarsSince(i OR a)<BarsSince(i OR b);
> g:=Cum(a OR Cross(a,0.5))-ValueWhen(1,i OR (f AND
> Alert(f=0,2)) OR (f=0 AND
> Alert(f,2)),Cum(a OR Cross(a,0.5)));
> If(f,g+1,g);
>
> Roy
>
>
>
> Yahoo! Groups SponsorADVERTISEMENT
>
> To unsubscribe from this group, send an email to:
> Metastockusers-unsubscribe@xxxxxxxxxxx
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now



To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxx

 

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