January 24, 2016
When we want to find out how many symbols belong to given category (such as watchlist) then for manual inspection, it is enough to hover the mouse cursor over the particular category name in the Symbols window and the information will be shown in a tooltip:
If we want to check such information using AFL code, we could read the list of symbols returned with CategoryGetSymbols and by counting commas (which separate symbol names) find out the number of tickers.
A reusable function is presented below:
function CategoryCountSymbols( category, number )
count = StrCount( list = CategoryGetSymbols( category, number ), ",");
return IIf( list == "", 0, count + 1 );
Title = "Symbols in watchlist 0: " + CategoryCountSymbols( categoryWatchlist, 0 );