Beyond the CCI-specific question above (and at the risk of stating the obvious), the solutions given in this thread show how AFL arrays can be used to straightforwardly calculate the percentage of truth for any condition over a lookback period.
Anyone interested in a somewhat generalized code approach to this is welcome to check out my take on it at my site, here: http://tinyurl.com/2lpnyv
