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

[amibroker] Re: Summation within exploration



PureBytes Links

Trading Reference Links

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 amibroker@xxxxxxxxxxxxxxx, "mpmafma" <mpmafma@xxx> 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.
>




Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/