Sum adds up the last "n" number of bars. It sums whatever you put into
the first part of the sum formula.

Cum(1) adds 1 to the previous value of Cum, so the first bar is 1 and
it just keeps adding one to the last bar value of cum(1). 
You can use Cum to add anything, like how many times you get rising
days in the entire chart:

Rise = C>ref(h,-1); //this gives results of 0 or 1
TotalRise = Cum(Rise);

You could limit this as well to time periods, or any other condition
Example would be one for total rise days since 1995:

RecentRise = C>O and Year()>=1995; //this gives results of 0 or 1 
TotalRise = Cum(RecentRise);


If you wanted to know how many rising days in the last 12 bars you
would use:

LastRises = Sum(Rise,12);

Hope this helps
-----------------------------------------------------------------
--- In [email protected], "mpmafma" <[EMAIL PROTECTED]> wrote:
>
> OK, I tried to do this myself but after extensive searching this forum 
> and the AFL database my last hope is to put my question on this forum.
> 
> What I try to do is to count the number of occurrences. For instance 
> Result = Open > ref(high,-1);
> 
> TotalResults = cum(Result);
> is not working.
> 
> There must be a way, anyone?
> 
> kind regards,
> 
> Frans.
>


Reply via email to