For anyone who might find this useful...
//Relative Strength % comparison
//to respective Index
//USING YAHOO DATABASE
SetChartOptions(0,chartShowDates);
//Relative Strength period of comparison
period = Param("Periods",21,10,252,1);
//Base Market
BaseMkt=WriteIf(MarketID(1)=="NYSE","^DJI",WriteIf(MarketID(1)=="Nasdaq","^NDX",WriteIf(MarketID(1)=="AMEX","^XAX","")));
//Base market....
//Relative strength calculation
x = Foreign(BaseMkt,"C") - Ref(Foreign(BaseMkt,"C"),-period);
x = (x / Ref(Foreign(BaseMkt,"C"),-period)) * 100;
y = C - Ref(C,-period);
y = ( y / Ref(C,-period)) * 100;
rs = y - x;
//line color
Color=colorBlue;
//Plot Relative strength line
Plot(rs,"",color,styleLine);
//Header
Title=EncodeColor(colorBlack)+"("+WriteVal(period,1)+") Day.."
+"Relative_Strength of ."+EncodeColor(Color)+FullName()+
EncodeColor(colorBlack)+".as compared to "+EncodeColor(color)
+ baseMkt +EncodeColor(colorBlack)+" = "+WriteVal(rs,1.2)+"\n"+"\n"+
FullName()+"\n"+"\n"+" MARKET = "+MarketID(1)+"\n"+" SECTOR =
"+SectorID(1)+"\n"+
" INDUSTRY = "+IndustryID(1);
//Exploration
//Note: you can change the relative strength setting using the Parameter button
in AA window...
Filter = rs >= Param("Relative_strength",0,-1000,1000,1) AND V >= 100000 ;
AddColumn(rs,"RS_%",1.2);
AddTextColumn(MarketID(1),"Market");
AddColumn(C,"close",1.2);
AddColumn(V,"Volume",1);
----- Original Message -----
From: Anthony Faragasso
To: [email protected]
Sent: Thursday, January 22, 2009 6:30 AM
Subject: [amibroker] Relative strength exploration
I would like to perform a Relative strength exploration between stocks and
their respective market.....
How do we iterate through the database and associate each stock with its
Market index when the database
contains several markets...
Thank you
Anthony
------------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.176 / Virus Database: 270.10.12/1908 - Release Date: 1/21/2009
9:15 PM