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

Re: [amibroker] Relative Sttrength



PureBytes Links

Trading Reference Links

please have a look at the attached code. This is a result of joined effort of Dr. S. Nathan Berger and myself. It is exploration which displays 5, 10,22 day, 9, 13, and 26 week rates of change (as well as the weighted combinations of them) which allow you to pick the strongest securities.

Regards,
Dima.

----- Original Message ----- 
From: jmp23834@xxxx 
To: amibroker@xxxxxxxxxxxxxxx 
Sent: Monday, September 17, 2001 4:54 PM
Subject: [amibroker] Relative Sttrength


I have a group of 5 mutual funds and I want to rotate into the 
strongest fund base on relative strength. When I use the "relstrength
("^spx")" in exploration I get results that seem to be a direct 
correlation to the ticker close price. I expected a positive number 
in MRS if I was outperforming the index and a negitave one for under
performance. The largest MRS should be the fund that is out 
performing the S&P by the largest margin. Can someone explain how AB 
calculates RS? I think I need to add some more code to get where I 
want but I need to understand the relstrength calculation first.

Thanks
John Pyle

Here is the code:

//**********Calculations
Periods = 28;

RS=relstrength("^spc");
MRS=EMA(RS,14);
RSChange=MRS-ref(MRS,-Periods);

Filter = Close >0;
NumColumns = 3;
Column0 = Close; Column0Name = "Close"; Column0Format=1.2;
Column1 = MRS; Column1Name = "MRS"; Column1Format=1.2;
Column2 = RSChange; Column2Name = "RSChange"; Column2Format=1.2;

Scan/Exploration Results:
Ticker, Date, Close, MRS, RSChange
FSPHX, 9/10/01, 126.02, 1629.87, 113.15,
FSVLX, 9/10/01, 47.83, 643.15, 8.23,      
FSELX, 9/10/01, 43.19, 598.78, -12.14,
FDCPX, 9/10/01, 33.61, 462.52, -24.58,      
FSESX, 9/10/01, 25.58, 332.23, -19.03,      




Yahoo! Groups Sponsor 
ADVERTISEMENT
                 
       
       

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


------=_NextPart_001_00E1_01C1409B.28B2CE80
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4807.2300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear John,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>please have a look at the attached code. This is a 
result of joined effort of Dr. S. Nathan Berger and myself. It is exploration 
which displays 5, 10, 22 day, 9, 13, and 26 week rates of change (as well as the 
weighted combinations of them) which allow you to pick the strongest 
securities.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Regards,</FONT></DIV>
<DIV><FONT face=Arial size=2>Dima.</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV 
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
jmp23834@xxxxxxxx 
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=amibroker@xxxxxxxxxx 
href="mailto:amibroker@xxxxxxxxxxxxxxx";>amibroker@xxxxxxxxxxxxxxx</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, September 17, 2001 4:54 
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [amibroker] Relative 
Sttrength</DIV>
<DIV><BR></DIV><TT>I have a group of 5 mutual funds and I want to rotate into 
the <BR>strongest fund base on relative strength. When I use the 
"relstrength<BR>("^spx")" in exploration I get results that seem to be a 
direct <BR>correlation to the ticker close price. I expected a positive number 
<BR>in MRS if I was outperforming the index and a negitave one for 
under<BR>performance.&nbsp; The largest MRS should be the fund that is out 
<BR>performing the S&amp;P by the largest margin. Can someone explain howAB 
<BR>calculates RS? I think I need to add some more code to get where I 
<BR>want but I need to understand the relstrength calculation 
first.<BR><BR>Thanks<BR>John Pyle<BR><BR>Here is the 
code:<BR><BR>//**********Calculations<BR>Periods = 
28;<BR><BR>RS=relstrength("^spc");<BR>MRS=EMA(RS,14);<BR>RSChange=MRS-ref(MRS,-Periods);<BR><BR>Filter 
= Close &gt;0;<BR>NumColumns = 3;<BR>Column0 = Close;&nbsp; Column0Name = 
"Close";&nbsp; Column0Format=1.2;<BR>Column1 = MRS;&nbsp; Column1Name= 
"MRS";&nbsp; Column1Format=1.2;<BR>Column2 = RSChange;&nbsp; Column2Name = 
"RSChange";&nbsp; Column2Format=1.2;<BR><BR>Scan/Exploration 
Results:<BR>Ticker,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Date,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 
Close,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MRS,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
RSChange<BR>FSPHX,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9/10/01,&nbsp;&nbsp; 
126.02,&nbsp;&nbsp; 1629.87,&nbsp;&nbsp; 
113.15,<BR>FSVLX,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9/10/01,&nbsp;&nbsp;&nbsp; 
47.83,&nbsp;&nbsp;&nbsp; 643.15,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 
8.23,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>FSELX,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
9/10/01,&nbsp;&nbsp;&nbsp; 43.19,&nbsp;&nbsp;&nbsp; 
598.78,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-12.14,<BR>FDCPX,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9/10/01,&nbsp;&nbsp;&nbsp; 
33.61,&nbsp;&nbsp;&nbsp; 462.52,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-24.58,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>FSESX,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
9/10/01,&nbsp;&nbsp;&nbsp; 25.58,&nbsp;&nbsp;&nbsp; 
332.23,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -19.03,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR><BR><BR><BR></TT><BR><BR><TT>Your 
use of Yahoo! Groups is subject to the <A 
href="http://docs.yahoo.com/info/terms/";>Yahoo! Terms of Service</A>.</TT> 
<BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_001_00E1_01C1409B.28B2CE80--

Attachment:

Attachment: Description: "Description: Binary data"