PureBytes Links
Trading Reference Links
|
Roy:
Thanks for the response. Sorry about the subject line.
Bob
Original Message:
-----------------
From: Roy Larsen rlarsen@xxxxxxxxxxxxxx
Date: Fri, 5 Sep 2003 16:57:51 +1200
To: equismetastock@xxxxxxxxxxxxxxx
Subject: Re: [EquisMetaStock Group] cum question
Bob
> I am creating an indicator that uses the cum function.
>
> Under certain conditions I want to reset the cum value
> to zero. How do I do this?
>
> Thanks.
>
> Bob
I haven't looked at this in a while but I think I ran into problems when I
tried to use Cum with PREV in order to facilitate a reset.
What does work with PREV that allows cumulation and reset is +. Here's an
example of how it works
{Cumulate Volume By Month}
A:=DayOfMonth()<ValueWhen(2,1,DayOfMonth());
If(A,V,PREV+V);
Another approach that works is to use Cum as below. It's so long ago since I
first put it together that I can't recall how it works. Initially I wanted
to count how many entry signals were received in the course of a trade. That
explains the set, reset and latch. I think it's a comparison between two
Cum()'s :)
Good luck
Roy
{Signal Counter}
{© 2003 Roy Larsen}
{rlarsen@xxxxxxxxxxxxxx}
A:=C<Ref(C,-4); {signal to count}
B:=DayOfMonth()=31; {signal to 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);
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/
--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/BefplB/TM
---------------------------------------------------------------------~->
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/
|