PureBytes Links
Trading Reference Links
|
Pablo, you are not paying attention - there is no need to use the
processing-hogging PREV functions to count up/down days.
This code plots exactly the same signals, without the PREV functions:
---8<-------------------------------
ind:=Mov(C,20,E);
DaysAbove:=BarsSince(ind<Ref(ind,-1));
DaysBelow:=BarsSince(ind>Ref(ind,-1));
DaysAbove;
DaysBelow;
---8<-------------------------------
jose '-)
http://www.metastocktools.com
--- In equismetastock@xxxxxxxxxxxxxxx, Paolo <italoarg76@xxx> wrote:
>
> mmbbrr79,
> Have U test the code I've coded for you ?
> Regards,
> Pablo
>
> Ind:=Mov(C,20,E); { Indicator Example }
> DaysAbove:=If(Ind>Ref(Ind,-1),1+ PREV,0);
> DaysBelow:=If(Ind <Ref(Ind,-1),1+ PREV,0);
> DaysEqual:=If(Ind =Ref(Ind,-1),1+ PREV,0);
> DaysAbove;
> DaysBelow;
> DaysEqual;
>
> As Explorer:
>
> ColA
> ++++
> Name: Above
> Ind:= Mov(C,20,E); { Indicator Example }
> If(Ind>Ref(Ind,-1),1+ PREV,0)
>
> ColB
> ++++
> Name: Below
> Ind:= Mov(C,20,E); { Indicator Example }
> If(Ind <Ref(Ind,-1),1+ PREV,0)
>
> ColC
> ++++
> Name: Equal
> Ind:= Mov(C,20,E); { Indicator Example }
> If(Ind =Ref(Ind,-1),1+ PREV,0)
>
>
> m> Could anyone assist me in writing an exploration that counts the
> m> number of days an indicator has risen or fallen? I'd like to
> m> include this in an Explorer that shows not only the value of a
> m> given indicator, but also what direction it is heading and for
> m> how long it has been heading in that direction.
> m> Thanks much!
> m> - M
------------------------ Yahoo! Groups Sponsor --------------------~-->
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/6pRQfA/fOaOAA/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/
|