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

Re: [EquisMetaStock Group] How to calculate beta of a stock over an Index in metastock


  • Date: Tue, 9 Mar 2010 09:12:18 +1300
  • From: "Roy Larsen" <rlarsen@xxxxxxxxxx>
  • Subject: Re: [EquisMetaStock Group] How to calculate beta of a stock over an Index in metastock

PureBytes Links

Trading Reference Links



Hi Ashis
 
 
Beta has been available as an indicator in MetaStock for many years and it even has instructions included as comments. The formula below from the August 2009 issue of MSTT has been updated to use the Security() function instead of the P variable (which is also called INDICATOR).
 
For the updated code to function the pathnames for the 5 indices must be changed to point to index data on your PC rather than mine. If you only require one index then either set all S# options to the same pathname and index or replace the {Referenced index options} with...
 
 {Referenced index options}
I:=Security("C:\Equis\Stocks\World Indices\$DJ",C); {DJIA}
 
... and set the pathname to match the location of that index.
 
 
Regards
 
Roy
 
 
 {Beta Updated}
 {Roy Larsen, 2009}
 
 {User settings}
N:=Input("Beta Updated,  periods",1,100,21);
X:=Input("Index,  1=DJIA  2=US$  3=FTSI  4=HS  5=SPX",1,5,1);
 
 {Referenced index options}
S1:=Security("C:\Equis\Stocks\World Indices\$DJ",C); {DJIA}
S2:=Security("C:\Equis\Stocks\World Indices\$DX",C); {US Dollar}
S3:=Security("C:\Equis\Stocks\World Indices\$FT",C); {FTSI 100}
S4:=Security("C:\Equis\Stocks\World Indices\$HS",C); {Hang Seng}
S5:=Security("C:\Equis\Stocks\World Indices\$SP",C); {S&P 500}
I:=If(X=1,S1,If(X=2,S2,If(X=3,S3,If(X=4,S4,S5))));
 
 {Beta}
P1:=N*Sum(ROC(C,1,%)*ROC(I,1,%),N);
P2:=Sum(ROC(C,1,%),N)*Sum(ROC(I,1,%),N);
P3:=N*Sum(Pwr(ROC(I,1,%),2),N)-
Pwr(Sum(ROC(I,1,%),N),2);
(P1-P2)/(P3+(P3=0));
 
 
 
----- Original Message -----
From: ashis
Sent: Tuesday, March 09, 2010 6:10 AM
Subject: [EquisMetaStock Group] How to calculate beta of a stock over an Index in metastock

 

Any body please help regarding the formula of  how to find out beta of a stock over an index.


BR

Ashis 



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4926 (20100308) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4926 (20100308) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___