CategoryRemoveSymbol
- remove a symbol from a category

Information / Categories
(AmiBroker 4.50)


SYNTAX CategoryRemoveSymbol( symbol, category, number )
RETURNS NOTHING
FUNCTION Removes the symbol from given category.

Note that for markets, groups, industries 'removing' means moving from given category to category with number zero, since the symbol is assigned always to one and only one market, group, industry and sector. This limitation does not apply to watchlists, favorites, and index categories. When symbol string is empty ("") then current symbol is used.

category is one of the following:

  • categoryMarket
  • categoryGroup
  • categorySector
  • categoryIndustry
  • categoryWatchlist
  • categoryFavorite
  • categoryIndex
  • categoryGICS
  • categoryICB

number is a market/group/industry/sector/watchlist number:
0..255 for categoryMarket, categoryGroup, categoryIndustry
0..63 for categorySector
no limit for categoryWatchlist.
ignored for categoryFavorite, categoryIndex

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. See http://en.wikipedia.org/wiki/Global_Industry_Classification_Standard for more details on GICS system
http://en.wikipedia.org/wiki/Industry_Classification_Benchmark for more details on ICB system

EXAMPLE // the code removes the symbols with last day volume < 1000
// from the watch list number 1
if( LastValue( V ) < 1000 )
{
   
CategoryRemoveSymbol( "", categoryWatchlist, 1 );
}
SEE ALSO CategoryAddSymbol() function , CategoryGetName() function , CategoryGetSymbols() function

References:

The CategoryRemoveSymbol function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.