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

Re: [amibroker] Re: Organize your WatchLists in Daily basis



PureBytes Links

Trading Reference Links

Dimitris,

The loop 
for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )

means: extract consecutive element (symbol) from the comma separated list
until the end of the list. StrExtract returns empty string "" at the end of the list.

The loop simply iterates through all symbols in the list.

As for my words from last e-mail:
Empty string has special meaning ___ONLY___ if used instead of ticker in 
CategoryAddSymbol( ticker, category, namber )
CategoryRemoveSymbol( ticker, category, number )

Internal implementation of these two functions just check for empty symbol
in a manner similar to this:

function CategoryAddSymbol( ticker, category, namber ) 
{
  if( ticker == "" ) ticker = Name(); 
 
 ....

}

It is just meant as a shortcut for writing formulas so you don't need to type Name().

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Sunday, October 26, 2003 12:30 PM
Subject: [amibroker] Re: Organize your WatchLists in Daily basis


> Tomasz,
> thank you for the simplified example.
> BTW, how should I know this "emtpy string means current symbol" ??
> I have met this "" in your code for GetCategorySymbols( category, 
> index ) 
> You write [and I use]
> 
> for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
> 
> Does it mean "sym not equal to current symbol" ??
> Because, in this looping, current symbol *will be included* in the 
> search...
> What I understood from this !="" was : all symbols [no matter how 
> many]. Did I miss something in this [important] loop ?
> Dimitris Tsokakis
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx> 
> wrote:
> > Dimitris,
> > 
> > No you dont need StrToNum() at all. and you don't need Name() 
> because "" emtpy string means current symbol.
> > 
> > Your code therefore can be simplified to:
> > 
> > // Some 4.46.0 applications
> > // Remove symbols from WLs
> > CategoryRemoveSymbol( "", categoryWatchlist, 30 ); 
> > CategoryRemoveSymbol( "", categoryWatchlist, 31 ); 
> > CategoryRemoveSymbol( "", categoryWatchlist, 32 ); 
> > CategoryRemoveSymbol( "", categoryWatchlist, 33 ); 
> > CategoryRemoveSymbol( "", categoryWatchlist, 34 ); 
> > CategoryRemoveSymbol( "", categoryWatchlist, 35 ); 
> > // Stochastic O/B, O/S criteria
> > OVERBOUGHT=LastValue(StochD()>70);
> > OVERSOLD=LastValue(StochD()<30);
> > WLNumber=IIf(OVERBOUGHT,30,IIf(OVERSOLD,32,31));
> > // add symbols to the respective WLs
> > CategoryAddSymbol(Name(),categoryWatchlist,WLNumber);
> > // Adv, Dec criteria
> > Adv=LastValue( C>Ref(C,-1) );
> > Dec=LastValue( C<Ref(C,-1) );
> > WLNumber1=IIf(Adv,33,IIf(Dec,35,34));
> > CategoryAddSymbol(Name(),categoryWatchlist,WLNumber1);
> > Filter=1;
> > AddColumn(C,"C");
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> >   ----- Original Message ----- 
> >   From: Dimitris Tsokakis 
> >   To: amibroker@xxxxxxxxxxxxxxx 
> >   Sent: Sunday, October 26, 2003 12:04 PM
> >   Subject: [amibroker] Organize your WatchLists in Daily basis
> > 
> > 
> >   The fresh 4.46.0, Oct22, 2003 gives some excellent possibilities 
> to automatically organize your WatchLists.
> >   Example:
> >   Select some Watchlists not in use, say WL30, WL31, WL32 to be the 
> stochastic O/B, CONGESTIVE, O/S respectively and
> >   WL33, WL34, WL35 to be the ADVISSUES, UNCISSUES and DECISSUES 
> respectively.
> >   Right after the new EODs download,  Explore all stocks, n=1 last 
> quotations with
> > 
> >   // Some 4.46.0 applications
> >   // Remove symbols from WLs
> >   CategoryRemoveSymbol( Name(), categoryWatchlist, 30 ); 
> >   CategoryRemoveSymbol( Name(), categoryWatchlist, 31 ); 
> >   CategoryRemoveSymbol( Name(), categoryWatchlist, 32 ); 
> >   CategoryRemoveSymbol( Name(), categoryWatchlist, 33 ); 
> >   CategoryRemoveSymbol( Name(), categoryWatchlist, 34 ); 
> >   CategoryRemoveSymbol( Name(), categoryWatchlist, 35 ); 
> >   // Stochastic O/B, O/S criteria
> >   OVERBOUGHT=StochD()>70;
> >   OVERSOLD=StochD()<30;
> >   WLNumber=IIf(OVERBOUGHT,30,IIf(OVERSOLD,32,31));
> >   z=StrToNum(NumToStr(WLNumber));
> >   // add symbols to the respective WLs
> >   CategoryAddSymbol(Name(),categoryWatchlist,z);
> >   // Adv, Dec criteria
> >   Adv=C>Ref(C,-1);
> >   Dec=C<Ref(C,-1);
> >   WLNumber1=IIf(Adv,33,IIf(Dec,35,34));
> >   z1=StrToNum(NumToStr(WLNumber1));
> >   CategoryAddSymbol(Name(),categoryWatchlist,z1);
> >   Filter=1;
> >   AddColumn(C,"C");
> > 
> >   then hit View->RefreshAll and all above  WatchLists will be 
> automatically updated for further use.
> >   Through Symbol->Categories->WatchLists->EditName you may name the 
> respective WatchLists.
> >   You may create now your own organization with various conditions.
> >   Note1: the new function CategoryAddSymbol( symbol, category, 
> number ) does not accept a variable inrut for "number", but the  
> >   StrToNum(NumToStr(variable)) will overcome this obstacle.
> >   Dimitris Tsokakis
> > 
> >         Yahoo! Groups Sponsor 
> >               ADVERTISEMENT
> >              
> >        
> >        
> > 
> >   Send BUG REPORTS to bugs@xxxx
> >   Send SUGGESTIONS to suggest@xxxx
> >   -----------------------------------------
> >   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 the Yahoo! Terms of 
> Service.
> 
> 
> 
> 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/ 
> 
> 
> 

------------------------ 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/