This is read-only version of AFL library entry. Ability to add user formulas
and comment is only available from members-only area.
Details:
Formula name:
Count Tickers in Watchlist
Author/Uploader:
Anthony Faragasso - ajf1111 [at] epix.net
Date/Time added:
2003-07-05 09:27:55
Origin:
Keywords:
Level:
medium
Flags:
showemail,function
DISCLAIMER: Most formulas present in AFL on-line library are submitted
by the users and are provided here on an "as is" and "as available" basis.
AmiBroker.com
makes no representations or warranties of any kind to the contents or the operation
of material presented here. We do not maintain nor provide technical support
for 3rd party formulas. Description:
This function will output the number of tickers in a selected watchlist
Formula:
//Count tickers in watchlist function
//Anthony Faragasso
//July 4, 2003
//Single watchlist output
WatchlistNumber=0;//enter watchlist number
function CountTickersInWatchList( Listnum )
{
// retrive comma-separated list of symbols in watch list
list = GetCategorySymbols( categoryWatchlist, listnum );
for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
if( i == 0 ) i = 0;
else i = i ;
}
return i;
}
Filter=1;
AddColumn(CountTickersInWatchList( WatchlistNumber),"Watchlist
#"+WriteVal(watchlistnumber,1),1);
Comments:
Anthony Faragasso ajf1111 [at] epix.net 2003-07-05 09:35:27
//Count tickers in watchlist function
//Anthony Faragasso
//July 4, 2003
//Multiple watchlist output
//Add watchlist here
WatchlistNumber0=0;//enter watchlist number
WatchlistNumber1=1;
WatchlistNumber2=2;
WatchlistNumber3=3;
/*********************************************/
function CountTickersInWatchList( Listnum )
{
// retrive comma-separated list of symbols in watch list
list = GetCategorySymbols( categoryWatchlist, listnum );
for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
if( i == 0 ) i = 0;
else i = i ;
}
return i;
}
//Sample header output for watchlist number with text read out.
/*text0=WriteIf(watchlistnumber0==0,"NDX","");
text1=WriteIf(watchlistnumber1==1,"DJI","");
text2=WriteIf(watchlistnumber2==2,"DJT","");
text3=WriteIf(watchlistnumber3==3,"DJU","");*/
Filter=1;
//Columns used for text read out
/*AddColumn(CountTickersInWatchList( WatchlistNumber0),text0,1);
AddColumn(CountTickersInWatchList( WatchlistNumber1),text1,1);
AddColumn(CountTickersInWatchList( WatchlistNumber2),text2,1);
AddColumn(CountTickersInWatchList( WatchlistNumber3),text3,1);*/
//Columns used for watchlist Number read out
AddColumn(CountTickersInWatchList( WatchlistNumber0),"Watchlist #"+WriteVal(watchlistnumber0,1),1);
AddColumn(CountTickersInWatchList( WatchlistNumber1),"Watchlist #"+WriteVal(watchlistnumber1,1),1);
AddColumn(CountTickersInWatchList( WatchlistNumber2),"Watchlist #"+WriteVal(watchlistnumber2,1),1);
AddColumn(CountTickersInWatchList( WatchlistNumber3),"Watchlist #"+WriteVal(watchlistnumber3,1),1);