[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Confirm Output



PureBytes Links

Trading Reference Links

Anthony,
Here is what I know for the subject.
The population of, say, WL12 is available through the lines 

//WatchList population
No=12;pop=0;
for( i = 0; ( StrExtract( CategoryGetSymbols( categoryWatchlist, 
No ), i ) ) != ""; i++ )
{
pop=pop+1;
}

Simply add +1 for any existing ticker.
Use it in IB or AA , it is independent of ApplyTo or Range Settings.
The equivalent form [since your i is zero based] is

//WatchList population
No=12;pop=0;
for( i = 0; ( StrExtract( CategoryGetSymbols( categoryWatchlist, 
No ), i ) ) != ""; i++ )
{
pop=i+1;
}
For the whole set of stocks the following reference may be useful.
//Population of WatchLists
pop=0;Title="Population of WLs"; 
for(k=0;k<64;k++)
{
 
for( i = 0; ( StrExtract( CategoryGetSymbols( categoryWatchlist, k ), 
i ) ) != ""; i++ )
{
pop=pop+1;
}
if(pop>0)
{Title=Title+"\n"+"WL"+WriteVal(k,1.0)+":"+WriteVal(pop,1.0);
pop=0;}
}
For easier reference the empty WLs are not included in the title.
Another approach is to create a comma separated string T with all WL 
populations and then just ask for the specific WL.

//The WL population string
//create first the string T
pop=0;T=""; 
for(k=0;k<64;k++)
{
 
for( i = 0; ( StrExtract( CategoryGetSymbols( categoryWatchlist, k ), 
i ) ) != ""; i++ )
{
pop=pop+1;
}
{T=T+WriteVal(pop,1.0)+",";
pop=0;}
}
//Apply now to WL20 by extracting the 20th element of this pop string
No=20;
WLpop=StrExtract(t,No);
Title=WLpop;

Try to keep the loops simple as possible and avoid useless if/else 
statements by initialising the parameters in the before the loop.
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso" <ajf1111@xxxx> 
wrote:
> Could others confirm this :
> 
> When I run the simple explore on my watchlist #0 which contains the 
^NDX and
> componets = 101
> 
> Filter=1;
> 
> addcolumn(c,"");
> 
> I get the number of rows at the bottom of AA = 101
> 
> BUT.....when I run the following function , it returns 102....This 
worked
> and returned the proper count until recently....
> 
> //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);
> 
> 
> 
> Thanks in advance
> 
> Anthony
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.551 / Virus Database: 343 - Release Date: 12/12/2003


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/