Hello,
The purpose of the RSC is to show how a security performs relative to another. However, simply dividing the price of a security by the price of another security should not allow one to draw any conclusions regarding their relative performance as the volatility of each security is not taken into consideration. For instance, say, the S&P 500 went up 10% in the last 20 days, and, in the meantime, Microsoft gained 12%.The RSC would tell us that Microsoft is performing better than the S&P 500. Now, say Microsoft is on average 50% more volatile than the S&P 500, we would expect Microsolft to gain 15% when the S&P500 gains 10% (knowing that stocks are rather well correlated with their indexes). Therefore, when we take volatility into consideration we might well draw a conclusion that is different than when we use the RSC alone.
I have therefore thought of creating a custom RSC that includes the volatility in its calculation in order to make more adequate conclusions about the relative performance of a security. That is where I need your help.
I thought I would use Beta. Beta being a measure of volatility of one security against another, I thought my custom RSC would simply be RSC/Beta which would allow me to have a good picture of a security's performance relative to its index.
I will use the symbol "spy" as the index.Knowing that the formula for Beta in metastock is:
[formula1]
(( 21 * Sum( ROC( CLOSE,1,%) * ROC( INDICATOR,1,%),21))-
( Sum( ROC( CLOSE,1,%),21) * Sum( ROC( INDICATOR,1,%), 21)))
/
(( 21 * Sum( Pwr( ROC( INDICATOR,1,%),2),21)) -
Pwr( Sum( ROC( INDICATOR,1,%),21),2))
I thought, for future backtests and explorations I should code the following in the indicator builder:
[formula2]
(( 21 * Sum( ROC( CLOSE,1,%) * ROC(Security("c:\Metastock Data\dataondemand cache\spy",C)
,1,%),21))-
( Sum( ROC( CLOSE,1,%),21) * Sum( ROC(Security("c:\Metastock Data\dataondemand cache\spy",C)
,1,%), 21)))
/
(( 21 * Sum( Pwr( ROC(Security("c:\Metastock Data\dataondemand cache\spy",C)
,1,%),2),21)) -
Pwr( Sum( ROC( INDICATOR,1,%),21),2))
For now, I am stuck here. Indeed, I thought that [formula1] was the same as [formula2] taken that I use the price plot of "spy" in formula 1. Now, when I plot the indicator given by formula 1 I end up with something completely different from what I get when I use formula 2.
Could you please indicate to me what I did wrong so I could fix my mistake and continue the elaboration of my custom RSC?
I will greatly appreciate your help.
Cheers,