PureBytes Links
Trading Reference Links
|
Hi Chellester
I don't know that my answer is better than Prestons but this is what I was writing while he was writing his.
Cum(1) accumulates 1 for each bar of a chart, starting from the first loaded bar. On the first bar the value of Cum(1) will be 1, on the second bar it will be 2 and on the 200th bar it will be 200.
So, summing Cum(1) for the first five bars will give the total of 1+2+3+4+5 =15 on the fifth bar. Since there is insufficient data to calculate a 5-bar Sum() before the 5th bar the first 4 bars will return N/A rather than a legitimate value.
On the 6th bar the result of Sum(Cum(1),5) will be 2+3+4+5+6, which of course is 20. In other words the value of Sum(Cum(1),5) will increase by 5 on each subsequent bar.
Cum() is a very simple MS function but its simplicity should not be mistaken uselessness. It has many uses and here are just a few.
{Bar Count}
Cum(1);
{Reverse Bar Count}
LastValue(Cum(1))-Cum(1);
{Last Bar}
LastValue(Cum(1))=Cum(1);
{First Bar}
Cum(1)=1;
{Difference}
{The "Event" variable an "N" constant must be defined before attempting to use in the following expression in a real formula}
Cum(X) - ValueWhen( Nth, Event, Cum(X));
(First Valid Bar}
{of A, B, C, etc..., variables must be defined before attempting to use in the following expression in a real formula}
Cum(IsDefined(A+B+C {etc...} ))=1;
Regards
Roy
----- Original Message -----
From: chellester2002
To: equismetastock@xxxxxxxxxxxxxxx
Sent: Monday, March 03, 2008 12:50 AM
Subject: [EquisMetaStock Group] Re: converting metastock formula to c#
> And just while I'm trying to work things out - please forgive me if
> this is dumb but can someone please tell me if
>
> Sum(Cum(1),5) = 15? I'm just getting all mixed up and confused.
> Thanks
>
Ok, I know it's not 15, but I can't figure out what it is
:(
__________ NOD32 2913 (20080301) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
[Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/equismetastock/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:equismetastock-digest@xxxxxxxxxxxxxxx
mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx
<*> 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/
|