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

RE: [amibroker] top10 [once again]



PureBytes Links

Trading Reference Links

Dimitris,

I have a database of only the NASDAQ 100 stocks.

How can this code be modified to scan the database (instead of a watchlist)
and place the TOP 10 into a watchlist?

Thank you

Rik Rasmussen

-----Original Message-----
From: DIMITRIS TSOKAKIS [mailto:TSOKAKIS@xxxxxxxxx]
Sent: Saturday, December 20, 2003 7:26 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] top10 [once again]


Here is another solution for the top10 list of WL5, as for the Stochd
() array.

// TOP LIST
top=10;WLno=5;
g=0;x=0;k=0;topList="";M="";
List=CategoryGetSymbols(categoryWatchlist,WLno);
for(d=1;d<top;d++)
{
for(i=0;(sym=StrExtract(List,i))!="";i++)
{
SetForeign(sym);
x=StochD();
RestorePriceArrays();
g=IIf(x>g,x,g);
}
for(i=0;(sym=StrExtract(List,i))!="";i++)
{
SetForeign(sym);
x=StochD();
topList=topList+WriteIf(x==g,sym,"")+WriteIf(x==g,",","");
M=M+WriteIf(X!=G,SYM,"")+WriteIf(X!=G,",","");
}
List=m;g=0;x=0;m="";
}
Filter=1;// any current stock for the n=1 last quotations
AddTextColumn(topList,"top"+WriteVal(top,1.0)+"List of WL"+WriteVal
(WLno,1.0));
Title="top"+WriteVal(top,1.0)+"List of WL"+WriteVal(WLno,1.0)
+" : "+topList;

Use it in IB or AA, the topList is free [outside any loop] for
further use.
The trick was to remove from the initial list the top stock of each
cycle. No composites, no auxiliary arrays, quite fast, no external
plugins, it seems good...
Dimitris Tsokakis



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:
 http://docs.yahoo.com/info/terms/



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:
 http://docs.yahoo.com/info/terms/