PureBytes Links
Trading Reference Links
|
Sidney,
I use this at times, maybe you can use it:
//Ranking formula in AA
//replace your watchlist number
list = CategoryGetSymbols( categoryGroup, 30 );
p = 90;
Count1= 0;
rank = 0;
symVal = 0;
relval = 0;
Ownval = ROC(C,p);
for ( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
symVal = Nz(Foreign( sym,
"Close" ));
relval = ROC(symval,
p);
n= Nz(IIf(relVal!=0,1,0));
Count1[BarCount- 1]=Count1[BarCount-1]+n[BarCount-1];
if (relval[BarCount-1] > Ownval[BarCount-1])
rank[BarCount- 1]
= rank[BarCount-1]+
1 ;
}
AddColumn (Count1,"count",1.0);
AddColumn (rank,"rank",1.0);
rank[BarCount- 1]
= int(100*(Count1[BarCount-1]-rank[BarCount-1])/Count1
[BarCount- 1]);
Filter = 1
;//AND IndustryID()==69;
AddColumn (Ownval,"ROC",1.2);
AddColumn (rank,"rank",1.0);
Anthony
----- Original Message -----
Sent: Wednesday, July 06, 2005 12:07
PM
Subject: Re: [amibroker] Difficulties
with indicator based ranking
At 07:06 AM 7/6/2005, you wrote:
This
Ranking and sorting stocks example might be useful to
you.
Bill
Sidney Kaiser wrote:
I have an on going problem with
wanting to rank stocks based on one or more
indicators. I remember now...I think Herman wrote
this one as an exercise in using static variables. It does run, altho
rather slowly. I have it on a chart for demo purposes. It is too
slow to incorporate into a back test imo.
Sid
Please
note that this group is for discussion between users only.
To get
support from AmiBroker please send an e-mail directly to SUPPORT {at}
amibroker.com
For other support material please check also: http://www.amibroker.com/support.html
---- LSpots keywords ?>---- HM ADS ?>
No virus found in this incoming message. Checked by AVG
Anti-Virus. Version: 7.0.323 / Virus Database: 267.8.8/35 - Release Date:
6/30/2005
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
---- LSpots keywords ?>
---- HM ADS ?>
YAHOO! GROUPS LINKS
|
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.8/35 - Release Date: 6/30/2005
|