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

RE: [amibroker] Sector and industry analysis



PureBytes Links

Trading Reference Links




<FONT face=Arial color=#0000ff 
size=2>Anthony,
<FONT face=Arial color=#0000ff 
size=2> 
Posted 
below  is an explanation I recently sent another member of the board. 
Depending on your time frame the sector information will change. I posted 
results of an exploration of a 7 day linreg of Relative strength of each sector 
as compared to the universe as a whole. The concept is similar to what you 
suggest. Instead of measuring against an index such as the S&P I measure 
against an index of my own construct.
<FONT face=Arial color=#0000ff 
size=2> 
You 
could easily adapt the code posted below to look at industry groups as well. The 
top down approach is easily accomplished using QP data and is in fact the back 
bone of the HGS software they tout at the site. The challenge I found using the 
HGS methodology was that the industry groups often contained too few stocks to 
really matter. A "group" of 3-5 stocks does not really make a representation. 
After perusing that line for over a year I came to conclusion (right or wrong) 
that Sectors offered a better picture. I am a visual trader and find that once I 
decide a sector is worth further examination that flipping through the charts of 
stocks in that sector can often yield good candidates. I tend to have a very few 
favorite stocks in each sector and avoid some sectors all together for a variety 
of reasons.
<FONT face=Arial color=#0000ff 
size=2> 
If you 
notice the number in the cross column next to Information you will see that it 
has only recently slipped below the index of all stocks. This indicates it is 
showing signs of weakness but may not be weak yet in longer time frames. A look 
at today's charts for CSCO, ORCL and CVC bear out this hypothesis. A day does 
not a trend make but today money was obviously taken off the table in this 
sector.....
 
Regards, 
Jayson 
 

from a recent 
post.......
The first step is to define your universe of stocks. It could be 
all the stocks in a given index or a list you arrive at by what ever data mining 
method you choose. Set your universe up as a watchlist then run this scan on 
that list with n last days=1 . Included is code to create sector indexes, new 
highs/new lows and advance/decline data for each sector and the universe at 
large. 
Once the scan completes you need to move the sector indexes to 
their own watchlist (they all start with ~i). You should have 13 indexes, one 
for each of the sectors and one called Index which is the composite comprised of 
all the stocks in your universe.
Next load the Sector RS code. Define the filter to your index 
watchlist and explore for n last days=1. Click on the headers to sort. Those 
sectors above the index (blue) are out performing the universe those below, 
under performing. Adjust the look back by changing the parameter in the 
RSC=linregslope line.
Regards, 
Jayson 
//Sector Analysis composite creation 
by Jayson Casavant
Buy=0;
newhigh=H>Ref(HHV(H,10),-1); 
//stocks making new high
newlow=L<Ref(LLV(L,10),-1); 
//Stocks making new low
up=C>Ref(C,-1);
dn=C<Ref(C,-1);
upvol=IIf(up,V/C,0);
dnvol=IIf(dn,V/C,0);
x=SectorID(0);
sym="~"+SectorID(1);
isym="~i"+SectorID(1);
Ad="~AD"+SectorID(1);
AddToComposite(C,sym ,"C"); //adds 
Close data to sector
AddToComposite(V/1000,sym,"V"); // 
adj vol overflow
AddToComposite(1,sym,"O"); //counts 
stocks
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(IIf(newhigh,1,0),sym,"H");//counts new highs
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(IIf(newlow,1,0),sym,"L");//Counts new Lows
//creates a master index of stocks 
under study
AddToComposite(C,"~Universe" 
,"c"); 
<FONT face=Arial 
color=#0000ff>AddToComposite(V/1000,"~Universe" ,"v"); 
AddToComposite(1,"~Universe" 
,"O"); 
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(newhigh,"~Universe","H");
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(Newlow,"~Universe","L");
//creates master index of OHLC 
data 
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(C,"~Index","C");
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(O,"~Index","O");
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(H,"~Index","H");
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(L,"~Index","l");
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(1,"~index","V");//counts stocks in index
//creates index by 
sector
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(C,isym,"C");
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(O,isym,"O");
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(H,isym,"H");
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(L,isym,"L");
<FONT face=Arial 
color=#0000ff>AddToComposite(1,isym,"V"); 
//creates advance /decline by sector 
composite
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(up,Ad,"C");
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(dn,Ad,"O");
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(upvol,Ad,"H");
<FONT face=Arial color=#0000ff 
size=2>AddToComposite(dnvol,Ad,"L");

 
//Sector Relative Strength 
Comparative by Jayson Casavant
Filter=C>0;
x=RelStrength("~index");
RSC=LinRegSlope(x,7);
<FONT face=Arial color=#0000ff 
size=2>AddColumn(IIf(rsc>0,BarsSince(rsc<=0),BarsSince(rsc>=0)),"Cross",1.0);
AddColumn(RSC,"Today 
RSC",1.2,colorDefault,IIf(RSC==0,colorBlue,IIf(rsc>Ref(rsc,-1),colorGreen,colorRed)));
AddColumn(Ref(RSC,-1),"Yesterday 
RSC",1.2,colorDefault,IIf(RSC==0,colorBlue,IIf(Ref(rsc,-1)>=Ref(rsc,-2),colorGreen,colorRed)));
AddColumn(Ref(RSC,-2),"2 
days",1.2,colorDefault,IIf(RSC==0,colorBlue,IIf(Ref(rsc,-2)>=Ref(rsc,-3),colorGreen,colorRed)));
AddColumn(Ref(rsc,-3),"3 
days",1.2,colorDefault,IIf(RSC==0,colorBlue,IIf(Ref(rsc,-3)>=Ref(rsc,-4),colorGreen,colorRed)));
AddColumn(Ref(rsc,-4),"4 
days",1.2,colorDefault,IIf(RSC==0,colorBlue,IIf(Ref(rsc,-4)>=Ref(rsc,-5),colorGreen,colorRed)));
AddColumn(Ref(rsc,-5),"5 
days",1.2,colorDefault,IIf(RSC==0,colorBlue,IIf(Ref(rsc,-5)>=Ref(rsc,-6),colorGreen,colorRed)));
AddColumn(Ref(rsc,-6),"6 
days",1.2,colorDefault,IIf(RSC==0,colorBlue,IIf(Ref(rsc,-6)>=Ref(rsc,-7),colorGreen,colorRed)));
AddColumn(Ref(rsc,-7),"7 
days",1.2,colorDefault,IIf(RSC==0,colorBlue,IIf(Ref(rsc,-7)>=Ref(rsc,-8),colorGreen,colorRed)));
AddColumn(Ref(rsc,-8),"8 
days",1.2,colorDefault,IIf(RSC==0,colorBlue,IIf(Ref(rsc,-8)>=Ref(rsc,-9),colorGreen,colorRed)));
AddColumn(Ref(rsc,-9),"9 
days",1.2,colorDefault,IIf(RSC==0,colorBlue,IIf(Ref(rsc,-9)>=Ref(rsc,-10),colorGreen,colorRed)));
AddColumn(Ref(rsc,-10),"10 
days",1.2,colorDefault,IIf(RSC==0,colorBlue,IIf(Ref(rsc,-10)>=Ref(rsc,-11),colorGreen,colorRed))); 

 
 
<FONT face=Tahoma 
size=2>-----Original Message-----From: Anthony Faragasso 
[mailto:ajf1111@xxxxxxxx]Sent: Wednesday, September 24, 2003 3:49 
PMTo: amibroker@xxxxxxxxxxxxxxxSubject: Re: [amibroker] 
Sector and industry analysis
Jayson,
 
Thank you for your input....I am trying to confirm 
my own explorations in AB to see if they match others using AB or match other 
findings on different web sites. Doing my exploration, I get the Information 
Sector as the leading Sector......whereas you have it listed 2nd from the 
bottom....
 
What is the purpose of the Universe / index Sector 
? Couldn't you just rank them as to which one is outperforming the others ? 
Outperforming the S&P 500 ? 
 
Would you be willing to share your formula 
? 
 
After you find the leading Sector , How do you find 
the leading Industry in that Sector and then , How do you find the leading 
Stocks in the Industry......I am trying to put this all together in AB....but 
have been running into Roadblocks....probably my own doing...:(
 
TIA
Anthony
 
 
 
 
 
 
----- Original Message ----- 
<BLOCKQUOTE 
>
  <DIV 
  >From: 
  Jayson 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Wednesday, September 24, 2003 12:59 
  AM
  Subject: RE: [amibroker] Sector and 
  industry analysis
  
  <FONT face=Arial color=#0000ff 
  size=2>Anthony,
  A 
  lot of my work revolves around sector rotation. My methods may not be exactly 
  what is found on the larger sites who compare all stocks in a given sector. 
  Instead I filter my Universe of stocks to around 700 based on min price, 
  volume and institutional ownership. I then create sector indexes with 
  addtocomposite. From there I compare the relative strength of each sector 
  against the universe and measure it using linregslope to watch for strength or 
  weakness on a daily basis. FWIW  here are my findings (short term, 7 
  days) as of the close of business today. The graphic shows the current 
  position of each sector as well as its history for the last 9 days. The trend 
  of each sector can be very telling. Notice that while Internet has been out 
  performing the Universe for 17 days that it is showing signs of weakness the 
  last 3. This type of behavior is a red flag for me that would encourage me to 
  tighten stops in long positions and perhaps look for bearish patterns for 
  Shorting opportunities. 
   
  <FONT face=Arial color=#0000ff 
  size=2>Regards, 
  Jayson 
   
  <IMG alt="" hspace=0 src="gif00537.gif" align=baseline 
  border=0>
   
   
   
  <FONT face=Tahoma 
  size=2>-----Original Message-----From: Anthony Faragasso 
  [mailto:ajf1111@xxxxxxxx]Sent: Tuesday, September 23, 2003 9:33 
  PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] 
  Sector and industry analysis
  Could someone let me know what Sector is outperforming the others and 
  Whatindustry is outperforming the others.....I am trying to confirm my 
  findingsfor both  in Amibroker.Also, what is your 
  source....AB, or some other site / 
  platform....TIAAnthony---Outgoing mail is 
  certified Virus Free.Checked by AVG anti-virus system (<A 
  href="">http://www.grisoft.com).Version: 
  6.0.520 / Virus Database: 318 - Release Date: 
  9/18/2003Send 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. 
  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. 
  
<BLOCKQUOTE 
><FONT 
  face="Courier New">---Outgoing mail is certified Virus 
  Free.Checked by AVG anti-virus system (<A 
  href="">http://www.grisoft.com).Version: 6.0.520 
  / Virus Database: 318 - Release Date: 9/19/2003Send 
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.


Attachment: Description: ""