NullCount

Miscellaneous functions 
SYNTAX  NullCount( array, mode = 1 ) 
RETURNS  NUMBER 
FUNCTION  Counts the number of consecutive nulls at the beginning of the array (mode = 1), at the end of the array (mode=2), from both ends (mode=3) and all nulls in the array (including nonconsecutive) (mode=0) 
EXAMPLE  x = MA( C, 20 ); 
SEE ALSO 
The NullCount function is used in the following formulas in AFL online library:
See updated/extended version online.