Whoops - the two DJ text files had the formulas screwed up.
For the 30 component stocks of the DJIA the combined, weighted MACD should have read:
(Security("AA",C)/C) *Security("AA",MACD())
+
(Security("AXP",C)/C) *Security("AXP",MACD())
+
(Security("BA",C)/C) *Security("BA",MACD())
+
(Security("BAC",C)/C) *Security("BAC",MACD())
+
(Security("C",C)/C) *Security("C",MACD())
+
(Security("CAT",C)/C) *Security("CAT",MACD())
+
(Security("CVX",C)/C) *Security("CVX",MACD())
+
(Security("DD",C)/C) * Security("DD",MACD()) +
(Security("DD",C)/C) *Security("DIS",MACD())
+
(Security("GE",C)/C) *Security("GE",MACD())
+
(Security("GM",C)/C) *Security("GM",MACD())
+
(Security("HD",C)/C) *Security("HD",MACD())
+
(Security("HPQ",C)/C) *Security("HPQ",MACD())
+
(Security("IBM",C)/C) *Security("IBM",MACD())
+
(Security("INTC",C)/C) *Security("INTC",MACD())
+
(Security("JNJ",C)/C) *Security("JNJ",MACD())
+
(Security("JPM",C)/C) *Security("JPM",MACD())
+
(Security("KFT",C)/C) *Security("KFT",MACD())
+
(Security("KO",C)/C) *Security("KO",MACD())
+
(Security("MCD",C)/C) *Security("MCD",MACD())
+
(Security("MMM",C)/C) *Security("MMM",MACD())
+
(Security("MRK",C)/C) *Security("MRK",MACD())
+
(Security("MSFT",C)/C) *Security("MSFT",MACD())
+
(Security("PFE",C)/C) *Security("PFE",MACD())
+
(Security("PG",C)/C) *Security("PG",MACD())
+
(Security("T",C)/C) *Security("T",MACD())
+
(Security("UTX",C)/C) *Security("UTX",MACD())
+
(Security("VZ",C)/C) *Security("VZ",MACD())
+
(Security("WMT",C)/C) *Security("WMT",MACD())
+
(Security("XOM",C)/C) *Security("XOM",MACD())
For the 14 day RSI it should have been:
(Security("AA",C)/C) *Security("AA",RSI(14)) + (Security("AXP",C)/C) *Security("AXP",RSI(14)) + (Security("BA",C)/C) *Security("BA",RSI(14)) + (Security("BAC",C)/C) *Security("BAC",RSI(14)) + (Security("C",C)/C) *Security("C",RSI(14)) + (Security("CAT",C)/C) *Security("CAT",RSI(14)) + (Security("CVX",C)/C) *Security("CVX",RSI(14)) + (Security("DD",C)/C) * Security("DD",RSI(14)) + (Security("DD",C)/C) *Security("DIS",RSI(14)) + (Security("GE",C)/C) *Security("GE",RSI(14)) + (Security("GM",C)/C) *Security("GM",RSI(14)) + (Security("HD",C)/C) *Security("HD",RSI(14)) + (Security("HPQ",C)/C) *Security("HPQ",RSI(14)) + (Security("IBM",C)/C) *Security("IBM",RSI(14)) + (Security("INTC",C)/C) *Security("INTC",RSI(14)) + (Security("JNJ",C)/C) *Security("JNJ",RSI(14)) + (Security("JPM",C)/C) *Security("JPM",RSI(14)) + (Security("KFT",C)/C) *Security("KFT",RSI(14)) + (Security("KO",C)/C) *Security("KO",RSI(14)) + (Security("MCD",C)/C) *Security("MCD",RSI(14)) + (Security("MMM",C)/C) *Security("MMM",RSI(14)) + (Security("MRK",C)/C) *Security("MRK",RSI(14)) + (Security("MSFT",C)/C) *Security("MSFT",RSI(14)) + (Security("PFE",C)/C) *Security("PFE",RSI(14)) + (Security("PG",C)/C) *Security("PG",RSI(14)) + (Security("T",C)/C) *Security("T",RSI(14)) + (Security("UTX",C)/C) *Security("UTX",RSI(14)) + (Security("VZ",C)/C) *Security("VZ",RSI(14)) + (Security("WMT",C)/C) *Security("WMT",RSI(14)) + (Security("XOM",C)/C) *Security("XOM",RSI(14))
To: equismetastock@xxxxxxxxxxxxxxx From: plieber@xxxxxxxxxxxxxx Date: Sun, 22 Feb 2009 16:31:21 -0500 Subject: RE: [EquisMetaStock Group] Backtesting S&P 600
Rajiv,
If I understand you correctly, you want the combined MACD
for all 600 stocks in the S&P 600! I�ve been doing this for years
with Indexes especially the 30 stocks that comprise the DJ-30.
If this is what you want to do, it's easier to put all 600
stocks plus the Index into one folder.
Next you make a series of indicators, 20 indicators with 30 securities
each. I'd name them "M1",
"M2", "M3", etc. The "M" stands for
MACD. If you were to use say RSI, I'd name the indicators "R1",
"R2", "R3", etc.
Next for indicator M1 put in the following formula"
security("aaa",MACD()) + security("bbb",MACD())
+ security("ccc",MACD()) + etc.
Note: the attached Text file has the code for all 600
stocks!
After doing all 20 indicators you want to add them all up
into one indicator. Call it MADC600 with
the formula fml(�M1�) + fml(�M2�) + �.fml(�M20�)
However the problem with the above is that it does not take
into account the individual weighting of each component stock. You don�t want to give the same weight of a
security that comprises 0.2% of total market capitalization to one that
comprises 1.1%.
The other problem with back testing indexes this way is that
the component change frequently (with the S&P�s it�s several times a year). I�ve believed this is one of the reasons why
most S&P trading systems eventually fail.
The nature of the index changes over time as the component mix changes.
The DJ-30 is a lot easier to weight because it is price
weighted. Attached are Text files of the
DJ Weighted MACD and DJ Weighted RSI14.
The indicators must be attached to a DJ-30 Index chart. I�ve had very good luck with timing the DJ-30
this way.
Pete
To: equismetastock@ yahoogroups.com From: rajiv1@xxxxxxcom Date: Sat, 21 Feb 2009 11:17:45 -0500 Subject: [EquisMetaStock Group] Backtesting S&P 600
I am trying to back test certain predefined indicators on S&P 600
Midcap. Metastock gives results and the final output for each stock.
Is it possible to say back test S&P 600 with MACD and get one final
number for the index rather than individual stocks?
Thanks,
Rajiv
__._,_.___
__,_._,___
|