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

[EquisMetaStock Group] Re: Count # of Days Indicator Has Risen/Fallen



PureBytes Links

Trading Reference Links

Try this:

---8<--------------------------------

indikator:=Mov(C,21,S);

indPeriods:=Cum(IsDefined(indikator));
indRise:=indikator>Ref(indikator,-1);
indFall:=indikator<Ref(indikator,-1);

riseTotal:=Cum(indRise);
risePercent:=riseTotal/indPeriods*100;
risePeriods:=BarsSince(indFall);

fallTotal:=Cum(indFall);
fallPercent:=fallTotal/indPeriods*100;
fallPeriods:=BarsSince(indRise);

{ Column variable here
ColA: indikator
ColB: risePercent
ColC: risePeriods
ColD: fallPercent
ColE: fallPeriods }

---8<--------------------------------


jose '-)
http://www.metastocktools.com




--- In equismetastock@xxxxxxxxxxxxxxx, "mmbbrr79" <markyboy5@xxx> 
wrote:
>
> Could anyone assist me in writing an exploration that counts the
> number of days an indicator has risen or fallen?  I'd like to
> include this in an Explorer that shows not only the value of a given
> indicator, but also what direction it is heading and for how long it
> has been heading in that direction.
> Thanks much!
> - M








------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
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/