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

Re: [amibroker] Re: relative strenght ranking



PureBytes Links

Trading Reference Links

Do you mean something like this:

//Comparative Analysis

//Anthony Faragasso

//

/*Choose markets to compare current active chart with.*/

/*To reduce number of Tickers...just put "" next to mkt variable*/

mkt1="^GSPC";//change ticker here

mkt2="DELL";//change ticker here

mkt3="MSFT";//change ticker here

//Chose your timeframe for comparison

barsAgo=100;

barno=LastValue(Cum(1))-barsAgo;//Starts N last bars ago

//Pick one and comment the other out

timeframe=barno;//will start at the N bar ago.

//timeframe=Year();

//timeframe=Month();

/***************************************/

startpoint =
IIf(timeframe==Year(),ValueWhen(Year()!=Ref(Year(),-1),Cum(1)),IIf(timeframe
==Month(),ValueWhen(Month()!=Ref(Month(),-1),Cum(1)),IIf(timeframe==barno,ba
rno,Null))); // the start point of comparision will be Yearly or monthly or
N bar ago.

//Current Active Chart

price = Close;

Color=colorBlue;

Currentchart = 100 * ( price/ValueWhen( Cum(1) == startpoint, price ) - 1 );

//Comparison chart #1

Color1=colorRed;

ticker1 = ParamStr( "Ticker1", mkt1);

price1 = Foreign(mkt1, "C");

Chart1 = 100 * ( price1/ValueWhen( Cum(1) == startpoint, price1 ) - 1 );

//Comparison chart #2

Color2=colorYellow;

ticker2=ParamStr( "Ticker2", mkt2);

price2 = Foreign(mkt2, "C");

Chart2 = 100 * ( price2/ValueWhen( Cum(1) == startpoint, price2 ) - 1 );

//Comparison chart #3

Color3=colorWhite;

ticker3=ParamStr( "Ticker3", mkt3);

price3 = Foreign(mkt3, "C");

Chart3 = 100 * ( price3/ValueWhen( Cum(1) == startpoint, price3 ) - 1 );

/******************************************************/

Plot(Currentchart,"",color,styleLine);

Plot(Chart1,"",color1,styleLine);

Plot(Chart2,"",color2,styleLine);

Plot(Chart3,"",color3,styleLine);

//plots vertical line at yearly or monthly intervals

Plot(IIf(timeframe==Year(),Year()!=Ref(Year(),-1),IIf(timeframe==Month(),Mon
th()!=Ref(Month(),-1),IIf(timeframe==barno,Null,0))),"",colorBlack,styleOwnS
cale|styleHistogram);

//Some title information

barnotitle=WriteIf(timeframe==barno,EncodeColor(color)+Name()+WriteVal(Curre
ntchart)+"\n"+EncodeColor(color1)+ticker1+WriteVal(Chart1)+"\n"+EncodeColor(
Color2)+ticker2+WriteVal(Chart2)+"\n"+EncodeColor(Color3)+ticker3+WriteVal(C
hart3),"");

Monthly=WriteIf(timeframe==Month(),EncodeColor(color)+Name()+WriteVal(Curren
tchart)+"\n"+EncodeColor(color1)+ticker1+WriteVal(Chart1)+"\n"+EncodeColor(C
olor2)+ticker2+WriteVal(Chart2)+"\n"+EncodeColor(Color3)+ticker3+WriteVal(Ch
art3),"");

Yearly=WriteIf(timeframe==Year(),EncodeColor(color)+Name()+WriteVal(Currentc
hart)+"\n"+EncodeColor(color1)+ticker1+WriteVal(Chart1)+"\n"+EncodeColor(Col
or2)+ticker2+WriteVal(Chart2)+"\n"+EncodeColor(Color3)+ticker3+WriteVal(Char
t3),"");

/****************************************************/



Title=WriteIf(timeframe==Year(),"Yearly...",WriteIf(timeframe==Month(),"Mont
hly...",WriteIf(timeframe==barno,"Startpoint is ..(
"+WriteVal(ValueWhen(barno==Cum(1),DateTime()),formatDateTime)+" )","")))+".
.Comparative Analysis for
:...."+EncodeColor(Color)+Name()+".."+EncodeColor(Color1)+ticker1+".."+Encod
eColor(Color2)+ticker2+".."+EncodeColor(Color3)+ticker3+"\n"+WriteIf(timefra
me==Month(),Monthly,WriteIf(timeframe==Year(),Yearly,WriteIf(timeframe==barn
o,barnotitle,"")));

----- Original Message ----- 
From: "thomasfroo" <thomasfroo@xxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Wednesday, October 22, 2003 9:15 AM
Subject: [amibroker] Re: relative strenght ranking


> A trouble I have with relstrength() is that i dont realy understand
> how i can compare the values between assests is there a way to get
> them in a scale that can be used for direct comparition?
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx> wrote:
> > Thomas,
> > you could use the relsrength() function, explore your database in
> AA then
> > simply click the heading to sort in the appropriate order. If you
> are
> > looking for code that does the sort for you Dimitris posted some
> examples
> > over the last couple of weeks with a heading of "One-step top10
> exploration
> > ". You could take a look in the yahoo archives
> >
> > Regards,
> > Jayson
> > -----Original Message-----
> > From: thomasfroo [mailto:thomasfroo@x...]
> > Sent: Tuesday, October 21, 2003 8:05 AM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] relative strenght ranking
> >
> >
> > I would like to do a ranking of how all stocks in amibroker
> > performed to a certain index and then rank them with numbers from
> 0-
> > 100 where 100 is the best performing percent. Do anyone know if
> this
> > is possible in amibroker or can point me to some afl files that do
> > similar things?
> >
> > best whishes
> > thomas
> >
> >
> >
> >       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/
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.530 / Virus Database: 325 - Release Date: 10/22/2003


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