SumSince

Moving averages, summation 
SYNTAX  SumSince( condition, array, incFirst = False ) 
RETURNS  Array 
FUNCTION  The function calculates running sum of array elements since condition was true. It works like:
or like:
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 
The SumSince function is used in the following formulas in AFL online library:
See updated/extended version online.