PureBytes Links
Trading Reference Links
|
<FONT face=Arial color=#0000ff
size=2>Eric,
what
are you missing at the top? I see "return n1" but you need something like
n1=bla,bla. I suggest you go back to the original post and be sure you have
copied all of it with out any of the >n1= type of
stuff. the carriage returns and line wraps can cause
problems
Regards,
Jayson
<FONT face=Tahoma
size=2>-----Original Message-----From: Eric Leake
[mailto:eleake@xxxxxxxxxxxxxxxxxx]Sent: Thursday, December 04, 2003
5:04 PMTo: palsanandSubject: re: [amibroker] Re: Ranking
study
Like I said, I'm an AFL loser! Here is a screen shot. Do I have something
wrapped wrong?
I really apologize for such sophomoric questions, but I've only had AB for
two weeks-trying to convert from AIQ.
Eric Leake
> Eric,the code works, make sure there are no
wrapping problems.Note also that in my example, I have N=101 stocks in my
N0=254 groupDimitris Tsokakis--- In <A
href=""><FONT
color=#0000ff>amibroker@xxxxxxxxxxxxxxx, "ericleake" <A
href=""><eleake@xxxx>
wrote:> Thanks for taking a crack at this Dimitris. This code is way over
my > head. In my dazed and confused state, I'm getting an error when
> checking: "Variable 'n1' used without being initialized." I thought
> n1 was initialized as "n1=sym;"??> > -Eric.>
> --- In <FONT
color=#0000ff>amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" >
<TSOKAKIS@xxxx>
wrote:> > Eric,> > here is another approach for the top5 RSI
of a database:> > > > function naming( listnum,ORdNo
)> > {> > list = GetCategorySymbols( categoryGroup, listnum
);> > for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )>
> {> > if(i==ORdno)> > {> > n1=sym;>
> }> > }> > return n1 ; > > } > >
function select( listnum )> > {> > list =
GetCategorySymbols( categoryGroup, listnum );> > Rank = 0; >
> for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )> >
{> > SetForeign(SYM,True,True);> > E1=RSI(); > >
f=LastValue(E1);> > Rank[BarCount-1-i] = f[i];> > }>
> return Rank ; > > }> > No=254;// replace 254 with your
GroupNo> > R= Select(No);> > H0=Select(No);G=0;> >
Plot(H0,"",2,2);> > G0=0;> > L1=LastValue(Cum(1));>
> N=101;// the population of group254> > TOP=5;> >
Counter=0;Title="Top"+WriteVal(top,1.0)+" RSI()"+"\n";> >
for(K=1;K<=TOP;K++)> > {> >
H1=LastValue(HHV(H0,n));> >
BAR1=LastValue((ValueWhen(H0==H1,Cum(1)-1)));> >
H0[BAR1]=-100000;> > Counter=Counter+1;> >
G0[L1-CountER]=-H1;> > shape=33+2*((Counter-1)%10);> >
PlotShapes((Cum(1)==bar1+1)*shape,Counter,0,Graph0,5);> >
Title=Title+WriteVal(Counter,1.0)+")"+WriteVal(H1)+ " ["+WriteVal>
(L1-> > bar1-1,1.0)+"-"+naming(254,L1-bar1-1)+"]"+ "\n";> >
}> > Plot((Cum(1)>L1-N)*R,"",(H0==-100000)*6+4,2);> >
Plot(0,"",1,1);> > > > I hope it is useful.> >
Dimitris Tsokakis> > GraphXSpace=3;> > > > --- In <A
href=""><FONT
color=#0000ff>amibroker@xxxxxxxxxxxxxxx, "ericleake" <A
href=""><eleake@xxxx>
> wrote:> > > > > Making my first attempt at a very
simple Relative Strength > > scan. > > > > > Using
the ROC function, I'm able to create a RS number. I'm > > also
> > > > > able to code a simple moving average qualifier for
a buy > > signal, > > > > as > > > >
> well as an exit. > > > > > > > > > >
What approach should I use then to rank the securities by > their
> > > > new > > > > > RS number, and buy say
the top 5? Would the new Percentile > > > > function >
> > > > be the way to handle this? Here is what I have so
far:> > > > > > > > > > Filter = GroupID()
== 0;> > > > > > > > > > RS = ROC(Close,
120);> > > > > Avg = EMA(Close, 28);> > > >
> > > > > > Exit = Close < Avg;> > > >
> > > > > > > > > > > > >
> > > NumColumns = 3;> > > > > Column0Name = "RS
Index";> > > > > Column0 =
RS;> > > > > > > > > > Any help would be
appreciated!> > > > > > > > > >
-Eric.------------------------ Yahoo! Groups Sponsor
---------------------~-->Buy Ink Cartridges or Refill Kits for your HP,
Epson, Canon or LexmarkPrinter at MyInks.com. Free s/h on orders $50 or more
to the US & Canada.<A
href=""><FONT
color=#0000ff>http://www.c1tracking.com/l.asp?cid=5511<A
href=""><FONT
color=#0000ff>http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM</
A>---------------------------------------------------------------------~-&g
t;Send BUG REPORTS to <FONT
color=#0000ff>bugs@xxxxxxxxxxxxxSend SUGGESTIONS to <A
href=""><FONT
color=#0000ff>suggest@xxxxxxxxxxxxx-----------------------------
------------Post AmiQuote-related messages ONLY to: <A
href=""><FONT
color=#0000ff>amiquote@xxxxxxxxxxxxxxx (Web page: <A
href=""><FONT
color=#0000ff>http://groups.yahoo.com/group/amiquote/messages/)-
-------------------------------------------Check group FAQ at: <A
href=""><FONT
color=#0000ff>http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to <A
href=""><FONT
color=#0000ff>http://docs.yahoo.com/info/terms/
<
----------------------- Original Message
-----------------------
From: "DIMITRIS TSOKAKIS" <A
href=""><FONT
color=#0000ff><TSOKAKIS@xxxxxxxxx>
To: <FONT
color=#0000ff>amibroker@xxxxxxxxxxxxxxx
Date: Thu, 04 Dec 2003 21:44:53 -0000
Subject: [amibroker] Re: Ranking study
Eric,the code works, make sure there are no wrapping problems.Note
also that in my example, I have N=101 stocks in my N0=254 groupDimitris
Tsokakis--- In <FONT
color=#0000ff>amibroker@xxxxxxxxxxxxxxx, "ericleake" <A
href=""><eleake@xxxx>
wrote:> Thanks for taking a crack at this Dimitris. This code is way over
my > head. In my dazed and confused state, I'm getting an error when
> checking: "Variable 'n1' used without being initialized." I thought
> n1 was initialized as "n1=sym;"??> > -Eric.>
> --- In <FONT
color=#0000ff>amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" >
<TSOKAKIS@xxxx>
wrote:> > Eric,> > here is another approach for the top5 RSI
of a database:> > > > function naming( listnum,ORdNo
)> > {> > list = GetCategorySymbols( categoryGroup, listnum
);> > for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )>
> {> > if(i==ORdno)> > {> > n1=sym;>
> }> > }> > return n1 ; > > } > >
function select( listnum )> > {> > list =
GetCategorySymbols( categoryGroup, listnum );> > Rank = 0; >
> for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )> >
{> > SetForeign(SYM,True,True);> > E1=RSI(); > >
f=LastValue(E1);> > Rank[BarCount-1-i] = f[i];> > }>
> return Rank ; > > }> > No=254;// replace 254 with your
GroupNo> > R= Select(No);> > H0=Select(No);G=0;> >
Plot(H0,"",2,2);> > G0=0;> > L1=LastValue(Cum(1));>
> N=101;// the population of group254> > TOP=5;> >
Counter=0;Title="Top"+WriteVal(top,1.0)+" RSI()"+"\n";> >
for(K=1;K<=TOP;K++)> > {> >
H1=LastValue(HHV(H0,n));> >
BAR1=LastValue((ValueWhen(H0==H1,Cum(1)-1)));> >
H0[BAR1]=-100000;> > Counter=Counter+1;> >
G0[L1-CountER]=-H1;> > shape=33+2*((Counter-1)%10);> >
PlotShapes((Cum(1)==bar1+1)*shape,Counter,0,Graph0,5);> >
Title=Title+WriteVal(Counter,1.0)+")"+WriteVal(H1)+ " ["+WriteVal>
(L1-> > bar1-1,1.0)+"-"+naming(254,L1-bar1-1)+"]"+ "\n";> >
}> > Plot((Cum(1)>L1-N)*R,"",(H0==-100000)*6+4,2);> >
Plot(0,"",1,1);> > > > I hope it is useful.> >
Dimitris Tsokakis> > GraphXSpace=3;> > > > --- In <A
href=""><FONT
color=#0000ff>amibroker@xxxxxxxxxxxxxxx, "ericleake" <A
href=""><eleake@xxxx>
> wrote:> > > > > Making my first attempt at a very
simple Relative Strength > > scan. > > > > > Using
the ROC function, I'm able to create a RS number. I'm > > also
> > > > > able to code a simple moving average qualifier for
a buy > > signal, > > > > as > > > >
> well as an exit. > > > > > > > > > >
What approach should I use then to rank the securities by > their
> > > > new > > > > > RS number, and buy say
the top 5? Would the new Percentile > > > > function >
> > > > be the way to handle this? Here is what I have so
far:> > > > > > > > > > Filter = GroupID()
== 0;> > > > > > > > > > RS = ROC(Close,
120);> > > > > Avg = EMA(Close, 28);> > > >
> > > > > > Exit = Close < Avg;> > > >
> > > > > > > > > > > > >
> > > NumColumns = 3;> > > > > Column0Name = "RS
Index";> > > > > Column0 =
RS;> > > > > > > > > > Any help would be
appreciated!> > > > > > > > > >
-Eric.------------------------ Yahoo! Groups Sponsor
---------------------~-->Buy Ink Cartridges or Refill Kits for your HP,
Epson, Canon or LexmarkPrinter at MyInks.com. Free s/h on orders $50 or more
to the US & Canada.<A
href=""><FONT
color=#0000ff>http://www.c1tracking.com/l.asp?cid=5511<A
href=""><FONT
color=#0000ff>http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM</
A>---------------------------------------------------------------------~-&g
t;Send BUG REPORTS to <FONT
color=#0000ff>bugs@xxxxxxxxxxxxxSend SUGGESTIONS to <A
href=""><FONT
color=#0000ff>suggest@xxxxxxxxxxxxx-----------------------------
------------Post AmiQuote-related messages ONLY to: <A
href=""><FONT
color=#0000ff>amiquote@xxxxxxxxxxxxxxx (Web page: <A
href=""><FONT
color=#0000ff>http://groups.yahoo.com/group/amiquote/messages/)-
-------------------------------------------Check group FAQ at: <A
href=""><FONT
color=#0000ff>http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to <A
href=""><FONT
color=#0000ff>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
Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
Yahoo! Groups Sponsor
ADVERTISEMENT
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 the Yahoo! Terms of Service.
|