Information / Categories
|SYNTAX||CategoryGetSymbols( category, index, mode = 0 )|
|FUNCTION|| Retrieves comma-separated list of symbols belonging to given category
0..255 for categoryMarket, categoryGroup, categoryIndustry
0..63 for categorySector
no limit for categoryWatchlist.
ignored for categoryFavorite, categoryIndex
mode - (new in 5.50) mode parameter decides what field is retrieved:
The meaning of index parameter is different for GICS and ICB categories - the index for categoryGICS and categoryICB is actually GICS/ICB code. Such as 10 for energy sector or 351010 for "Health Care Equipment & supplies" industry. The codes are fixed even if new classifications are added at some point in the future. This means that you won't need to change AFL codes even if new classifications are added. But it is important to understand that these codes work in hierarchical way. So
GetCategorySymbols( categoryGICS, 10 )
will return all symbols belonging to energy sector, including those in 10101010 - Oil & Gas Drilling sector as well as 10102050 - Coal & Consumable Fuels; for example.
for more details on GICS system
Use StrExtract function to extract individual symbols from the list.
Example 2, retrieving all symbols tickers and full names
|SEE ALSO||GETCATEGORYSYMBOLS() function , StrExtract() function , INWATCHLIST() function , CategoryGetName() function|
The CategoryGetSymbols function is used in the following formulas in AFL on-line library:
See updated/extended version on-line.