Mechanical Investing with Technical Analysis
Inspired by the numerous discussion about using tecnical analysis (TA) together with mechanical investing (MI) and with the data from the SIPRO backtester, I decided to do some tests and see whether MI with TA may show an improvement compared to "straight" MI.
/Disclaimer: I do no think or pretend in any way that my findings represent the reality of using these screens, and as always they may or may not necessarily say anything about the future. As far as my own opinions are concerned, they are just that, opinions. I'm sure there may ways to improve the testing methology, and suggestions are welcome if presented in a polite matter and taking the limited availability of data into consideration./
Taking into consideration the limited availability of data, the tests were done as follows:
First, I ran all the SIPRO defined screens with starting date 2001-12-29 up until 2004-05-28, monthly top 5. I ran it first as "straight MI" (no TA used), then with TA using a simple moving average.
Using the same dates, I ran all the screens three more times with parameters "--buyma=24,5,1", "--buyma=24,5,0.97" and "--buyma=24,5,0.95". In my software "--buyma=LMA,SMA,LMAMULT" means that a stock is only bought (at rebalancing time) if SMA [short moving average] is larger than (LMA [long moving average] times LMAMULT [LMA factor]). So "--buyma=24,5,0.97" means the buy criteria is that the 5 day moving average is equal to or larger than the 24 day moving average times 0.97.
As a curiosity I also implemented and tested a "--sellma" option similar to "--buyma" which would sell a held security on the same day the signal was triggered. After the first four runs, the test clearly showed that the "--sellma" was never really able to beat the "straight MI" option, at least not with the 24,5,[1,0.97,0.95] set of parameters, so no further tests using "--sellma" was done.
With these four runs, I got four sets of CAGR and GSD numbers.
Then I attempted to "rerun" the tests using out-of-sample data. Unfortunately, prior to end of June 2003, only monthly data is available, so the out-of-sample data used was monthly data available after June 2003 using a different start week. This means I reran the four runs described earlier using starting weeks 2003-07-03, 2003-07-11 and 2003-07-18. This gave me three more complete sets each containing four sets of CAGR and GSD numbers.
/Warning: Yes, I am aware that in doing it this way, I get one set of numbers for the longer running backtest, and then three different sets of numbers for the shorter backtests. Comparing these numbers may or may not make any sense, since they are taken from different periods of time. Regardless, I just wanted to see if MI+TA could improve performance using the backtest data available, so I compared them regardless of whether it is the correct thing to do or not. I would guess comparing them would give more meaningful results than not comparing anything at all./
I collected the relevant numbers in a spreadsheet and calculated the average values for CAGR and GSD for each run for each screen, as demonstrated below:
78RPM CAGR GSD StDev(CAGR)
Non-TA 71.28 42.82 41.38
--buyma=24,5,1 81.07 40.40 72.33
--buyma=24,5,0.97 66.66 40.44 55.16
--buyma=24,5,0.95 67.97 40.70 53.75
These were the actual numbers I then looked at to evaluate my findings. In the example above, we see that the --buyma=24,5,1 additional criteria for buying on average raised the backtested CAGR with ten percent points and lowered GSD with a couple. However, it also shows that StDev(CAGR) increases significantly. Looking at the underlying numbers, the actual CAGR number for the four --buyma=24,5,1 runs are 31, 137, 149 and 8 versus 37, 73, 129 and 46 for the "straight MI" runs, so I find it a bit hard to conclude anything about this. In my spreadsheet I marked the 24,5,1 row as "yellow" meaning "maybe" with regards to whether TA has any significant effect with this screen.
So, without further ado, I present the summary with the rest of my findings here (excluding 78RPM which has been mentioned already). You can also download the complete spreadsheet with the numbers from here ([Excel http://kjeldahl.net/investing/data/tami.xls], [OpenOffice http://kjeldahl.net/investing/data/tami.sxc]).
In short, 78RPM, POG and Microcap_Momentum showed "potential" (marked with a yellow background in the spreadsheet). 78RPM had a possible improvement as already shown using --buyma=24,5,1, while POG shows the following numbers:
POG CAGR GSD StDev(CAGR)
Non-TA 27.59 42.59 13.06
--buyma=24,5,1 26.78 43.25 12.66
--buyma=24,5,0.97 30.06 44.81 9.66
--buyma=24,5,0.95 33.30 45.57 8.30
As shown above, CAGR for POG increases with stricter requirements for buying, while GSD also increasing somewhat. Interestingly enough, the StDev(CAGR) of CAGR also goes down.
Microcap_Momentum shows the following numbers:
Microcap_Momentum CAGR GSD StDev(CAGR)
Non-TA 144.83 54.87 57.53
--buyma=24,5,1 203.98 58.82 84.84
--buyma=24,5,0.97 178.96 56.87 62.39
--buyma=24,5,0.95 144.58 53.82 58.82
The two mid rows here are marked yellow in the spreadsheet. --buyma=24,5,1 has a nice high CAGR, but also increases GSD somewhat. StDev(CAGR) increases significantly, which again is a bit scary (meaning returns from the different starting weeks differ significantly).
During this research, I also found some results that may indicate that in some cases (with some screens) there may be something to gain from using TA with MI. These are marked with green backgrounds in the spreadsheet.
Melange shows some nice improvements using TA:
Melange CAGR GSD StDev(CAGR)
Non-TA 14.71 38.66 23.65
--buyma=24,5,1 26.12 37.70 11.15
--buyma=24,5,0.97 22.78 38.20 23.82
--buyma=24,5,0.95 19.28 36.94 17.50
In my spreadsheet, the second row is marked with green (--buyma=24,5,1), although all the additional TA requirements point in the same direction. Using TA to get a stricter buy criteria seems to improve most of the numbers. Small changes in the TA parameters and the different starting weeks seem to verify the direction of the improvement.
PIH_Naked CAGR GSD StDev(CAGR)
Non-TA 20.33 45.88 25.77
--buyma=24,5,1 26.45 45.53 26.02
--buyma=24,5,0.97 23.77 45.73 23.20
--buyma=24,5,0.95 23.77 45.73 23.20
The second row is marked green in the spreadsheet. Again, most TA parameters seem to improve returns and reduce variability somewhat. It may not be as significant as with Melange, but maybe worth noting.
Net-Nets_Grahamified CAGR GSD StDev(CAGR)
Non-TA 43.27 44.92 10.98
--buyma=24,5,1 120.40 37.88 59.86
--buyma=24,5,0.97 121.95 33.03 47.34
--buyma=24,5,0.95 142.75 31.55 65.96
Net-Nets shows significant gains when using TA, and all --buyma rows are marked green in the spreadsheet. GSD is also down when using TA. However, starting week variability is still significant, as demonstraded with the high StDev(CAGR) numbers. But still, significantly higher CAGR and lower GSD.
S&P_Peg CAGR GSD StDev(CAGR)
Non-TA 24.82 19.87 8.08
--buyma=24,5,1 32.51 18.19 6.74
--buyma=24,5,0.97 29.05 19.28 3.66
--buyma=24,5,0.95 23.00 18.93 4.05
The two mid rows are marked green in the spreadsheet. S&P_Peg is less spectacular (as always), but TA shows improvement in the key parameters.
Small_Value CAGR GSD StDev(CAGR)
Non-TA 81.54 40.73 31.50
--buyma=24,5,1 115.28 41.55 43.31
--buyma=24,5,0.97 98.15 42.56 37.44
--buyma=24,5,0.95 107.01 42.11 46.33
All three rows with --buyma parameters are marked as green in the spreadsheet. CAGR for the TA rows shows improved gains, without too much increase in GSD and some more variation in starting week differences.
Turnarounds CAGR GSD StDev(CAGR)
Non-TA 13.12 36.29 5.29
--buyma=24,5,1 26.95 36.89 7.69
--buyma=24,5,0.97 26.95 36.89 7.69
--buyma=24,5,0.95 27.01 36.90 7.69
Again, Turnarounds shows some improvements. The two middle rows are marked green in the spreadsheet, but as you can see their numbers are identical which indicate that the picks were identical for those sets of parameters.
I'm not going to claim all these findings are significant or not. I am aware that the backtesting period is probably too short and data availability too limited to be too bombastic about the results.
Assuming you would want to use TA with MI, you need to write/use some software that is able to calculate moving averages or similar at rebalancing time. If you have no clue about how to go about doing this, feel free to contact me and maybe I can point you in the right direction as I have already implemented a "get stock quotes on demand" system at my end for the purposes of using it with the backtester and possibly other stuff. In all, it fetched 153653 quotes to be able to do the backtests done in this project and it ran over the course of three days - most of the time waiting for quote retrieval (e.g. to calculate a 24 day moving average, you need quotes for the previous 24 days...)
Add new comment