PureBytes Links
Trading Reference Links
|
Tomasz,
I responded to Dimitri's post before realizing that
you had actually provided a solution....I was thinking the same thing, but did
not know how to put it into a formula....
Anthony
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Tomasz Janeczko
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Saturday, February 28, 2004 6:24
AM
Subject: Re: [amibroker] Re: empty scan
of a watchlist (?)
Hello,
> The only safe way to count [and use it as a daily
function] is > through AddToComposite() function.This is NOT
entirely true.
The code you are using counts simply the number of items in
comma separated
list of tickers. There are 3 strings so the result is
thee.
BUT THERE IS NOTHING THAT PREVENTS US FROM COUNTING ON BAR
BY BAR BASIS
and this does NOT really require AddToComposite, see the
code below:
//Count tickers in watchlist
function <FONT
color=#008000>//For Indicator Builder<FONT
face="Courier New"> WatchlistNumber=<FONT
color=#0000ff>Param(<FONT
color=#ff00ff>"Watchlist",<FONT
color=#ff00ff>20,<FONT
color=#ff00ff>0,<FONT
color=#ff00ff>63,<FONT
color=#ff00ff>1) ;<FONT
color=#008000>//enter watchlist number<FONT
face="Courier New"> <FONT
color=#800000>function<FONT
color=#000000> CountTickersInWatchList( Listnum ) {
// retrive comma-separated
list of symbols in watch list<FONT
color=#000000> list = <FONT
color=#0000ff>GetCategorySymbols( <FONT
color=#000000>categoryWatchlist<FONT
face="Courier New">, listnum );
Counter=0<FONT
color=#000000>; // INITIALIZE
COUNTER
for<FONT
color=#000000>( i = 0; (
sym = StrExtract( list,
i ) ) != ""<FONT
face="Courier New">; i++ )
{ <FONT
color=#008000>// TO COUNT BAR BY BAR YOU HAVE TO USE ARRAYS NOT
SCALAR<FONT
color=#008000> AND USE FOREIGN TO FIND OUT
HOLES<FONT
color=#000000> Counter=Counter + (
NOT <FONT
color=#0000ff>IsNull( <FONT
color=#0000ff>Foreign( sym, <FONT
color=#ff00ff>"C", <FONT
color=#000000>False<FONT
color=#000000> ) ) ); }
<FONT
color=#800000>return<FONT
color=#000000> Counter; } <FONT
color=#000000>Title=<FONT
color=#ff00ff>"Watchlist # "+<FONT
color=#0000ff>WriteVal(watchlistnumber,<FONT
color=#ff00ff>1)+" has
"+
CountTickersInWatchList( WatchlistNumber) + "
Tickers";
Plot<FONT
color=#000000>(CountTickersInWatchList( WatchlistNumber) ,<FONT
color=#ff00ff>"",<FONT
color=#ff00ff>1,<FONT
color=#ff00ff>1);
Plot(<FONT
color=#0000ff>Foreign(<FONT
color=#ff00ff>"~count",<FONT
color=#ff00ff>"v"),<FONT
color=#ff00ff>"",<FONT
color=#ff00ff>4,<FONT
color=#ff00ff>2);
Best regards,Tomasz
Janeczkoamibroker.com
----- Original Message -----
From: "DIMITRIS TSOKAKIS" <<A
href=""><FONT
size=2>TSOKAKIS@xxxxxxxxx>
To: <<A
href=""><FONT
size=2>amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, February 28, 2004 9:45 AM
Subject: [amibroker] Re: empty scan of a watchlist
(?)
> Anthony,> One
important detail !> The code counts the symbols of WLxx, it DOES NOT
give the population > of WLxx in daily basis.> If you have 3
tickers in WL20 and there are some missing data, the > result will
still be 3.> The only safe way to count [and use it as a daily
function] is > through AddToComposite() function.> Try to delete
some quotations in WL20 stocks, run the>
AddToComposite(1,"~count","v");> Buy=0;> for WL20 and then plot
the> //Count tickers in watchlist function> //For
Indicator Builder> WatchlistNumber=Param("Watchlist",20,0,63,1)
;//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++ )> {>
Count1=i;> }> return i;> }> Title="Watchlist #
"+WriteVal(watchlistnumber,1)+" has "+> CountTickersInWatchList(
WatchlistNumber) + " Tickers";> Plot(CountTickersInWatchList(
WatchlistNumber) ,"",1,1);> Plot(Foreign("~count","v"),"",4,2);
> and you will see.> [We have a recent discussion with Stephane
on the same subject.]> The reason should be simple: If WL20 includes
IBM, INTC and MSFT, > then there should be somewhere an inside
syntax > WL20="IBM,INTC,MSFT", in other words WL20 should be nothing
but a > comma separated string. This fact does not include any info
about > missing [or excessive] bars.> Dimitris Tsokakis>
--- In <FONT
size=2>amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso"
<ajf1111@x<FONT
size=2>...> > wrote:> > Dalengo,> > >
> Put this into Indicator builder, you can use Parameter to select
> different> > watchlist....the total count will be in the
title.> > > > > > //Count tickers in watchlist
function> > > > //For Indicator Builder> >
> > WatchlistNumber=Param("Watchlist",0,0,63,1) ;//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++ )> > >
> {> > > > Count1=i;> > > >
}> > > > return i;> > > > }>
> > > Title="Watchlist # "+WriteVal(watchlistnumber,1)+" has
"+> > > > CountTickersInWatchList( WatchlistNumber) + "
Tickers";> > > > > > > >
Anthony> > > > ----- Original Message ----- > >
From: "dalengo" <<FONT
size=2>dalengo@x...>> > To: <<A
href=""><FONT
size=2>amibroker@xxxxxxxxxxxxxxx>> >
Sent: Friday, February 27, 2004 12:29 PM> > Subject: [amibroker]
empty scan of a watchlist (?)> > > > > > >
Hi,> > > Can someone help with the scan of a watchlist
function?> > > I am trying a trivial counting of entries in N100
watchlist> > > by scanning the AFL AB 4.51.1:> >
>> > > AddToComposite(1,"~COUNT","V");> > >
Buy=0;> > >> > > N100 is in List0, and all entries
in List0 are valid (display> > > properly).> > > I
use filter:list0 in AA to aim AA at list0 per User Guide,> > >
run the Scan and get nothing.> > > Run for CURRENT stock, get
~COUNT=1, run for ALL STOCKS, get> > > (in US-Stocks) ~COUNT=6592
on 2/23/04, again for one stock, get 1.> > > Run again on List0
using Filter: get nothing (old result remains> > >
unchanged).> > >> > > What's wrong?> >
>> > > Many thanks for your suggestions,> > >
-Dalengo> > >> > >> > >> >
> Send BUG REPORTS to <FONT
size=2>bugs@x...> > > Send SUGGESTIONS to
suggest@x<FONT
size=2>...> > > ----------------------------------------->
> > Post AmiQuote-related messages ONLY to: <A
href=""><FONT
size=2>amiquote@xxxxxxxxxxxxxxx> > > (Web
page: <FONT
size=2>http://groups.yahoo.com/group/amiquote/messages/<FONT
size=2>)> > >
--------------------------------------------> > > Check group FAQ
at:> > <A
href=""><FONT
size=2>http://groups.yahoo.com/group/amibroker/files/groupfaq.html<FONT
size=2>> > > Yahoo! Groups Links> > >> >
>> > >> > >> > >> >
> > > > ---> > Outgoing mail is certified Virus
Free.> > Checked by AVG anti-virus system (<A
href=""><FONT
size=2>http://www.grisoft.com).> > Version:
6.0.583 / Virus Database: 369 - Release Date: 2/10/2004> >
> > Send BUG REPORTS to <A
href=""><FONT
size=2>bugs@xxxxxxxxxxxxx> Send SUGGESTIONS to
<FONT
size=2>suggest@xxxxxxxxxxxxx>
-----------------------------------------> Post AmiQuote-related
messages ONLY to: <FONT
size=2>amiquote@xxxxxxxxxxxxxxx > (Web page:
<FONT
size=2>http://groups.yahoo.com/group/amiquote/messages/<FONT
size=2>)> --------------------------------------------> Check
group FAQ at: <A
href=""><FONT
size=2>http://groups.yahoo.com/group/amibroker/files/groupfaq.html<FONT
size=2> > Yahoo! Groups Links> > <*> To visit your
group on the web, go to:> <A
href=""><FONT
size=2>http://groups.yahoo.com/group/amibroker/<FONT
size=2>> > <*> To unsubscribe from this group, send an email
to:> <A
href=""><FONT
size=2>amibroker-unsubscribe@xxxxxxxxxxxxxxx>
> <*> Your use of Yahoo! Groups is subject to:>
<A
href=""><FONT
size=2>http://docs.yahoo.com/info/terms/>
> > Send BUG REPORTS to
bugs@xxxxxxxxxxxxxSend SUGGESTIONS to
suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
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
Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|