SumSince
- sum of array elements since condition was tru

Moving averages, summation
(AmiBroker 6.10)


SYNTAX SumSince( condition, array, incFirst = False )
RETURNS Array
FUNCTION The function calculates running sum of array elements since condition was true. It works like:

x = Cum( array ) - ValueWhen( condition, Cum( array ) );

or like:

x = Sum( array, BarsSince( condition ) );

but much faster.

When incFirst is set to True, the sum includes the very first value at the bar when condition was true.

EXAMPLE
SEE ALSO Cum() function , Sum() function , BarsSince() function , ValueWhen() function

References:

The SumSince function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.