Friday, August 17, 2007

spx moving average crossover

Downtrending moving average crossover

One phenomenon I've noted is the tendency of a stock to outperform once it punctures a down-trending moving average, with the upward movement proportional to the time spent under the moving average. This seems somewhat borne out by some studies done with some simple systems:

1. Buy at the 12 week EMA stop if n or greater closes have been below the 12 week EMA.

2. Sell in 3 months (12 weeks); this should give some sense of the power of this event to predict future price movement.

Compaq:

[ Here n = number of weeks to hold after a 3 closes-below the moving average moving average break.]

n: NetPrft PFact ROA #Trds %Prft AvgTrd

12.00 16.05* 3.95* 229.59 21 76 .76*

11.00 13.85 3.93 198.18 21 81* .66

10.00 8.10 2.46 115.85 22 73 .37

9.00 10.10 3.45 144.43 23 65 .44

8.00 6.28 1.48 56.18 25 64 .25

7.00 .47 1.03 4.62 27 59 .02

6.00 7.02 1.80 100.39 28 64 .25

5.00 6.94 1.62 73.02 28 50 .25

4.00 4.28 1.43 45.44 29 69 .15

3.00 3.34 1.35 41.68 30 67 .11

2.00 5.42 1.56 55.21 32 63 .17

1.00 -.65 .95 -6.95 39 54 -.02

.00 -5.44 .63 -51.18 55* 45 -.10

Note that the longer the holding period, the greater the subsequent gain and the greater the percentage of trades that were profitable.

n: NetPrft PFact #Trds %Prft AvgTrd

9.00 -.41 .92 8 63 -0.05

8.00 12.40 3.36 12 75 1.03

7.00 17.28 4.29 13 77 1.33*

6.00 12.06 3.06 14 71 .86

5.00 12.55 3.33 16 63 .78

4.00 11.39 2.85 19 63 .60

3.00 16.05 3.95 21 76 .76

2.00 19.26* 7.35* 24 83* .80

1.00 11.62 2.15 29 72 .40

Last week's close above moving average:

n: NetPrft PFact #Trds %Prft AvgTrd

25.40* 2.18 50* 72 .51

9.00 24.33 17.86 15 73 1.62

8.00 20.20 16.06 16 69 1.26

7.00 20.33 10.76 17 76 1.20

6.00 18.83 19.19 17 82 1.11

5.00 21.41 10.30 19 74 1.13

4.00 4.30 1.28 21 67 .20

3.00 6.51 1.42 23 70 .28

2.00 16.66 3.29 23 74 .72

1.00 17.99 4.48 24 75 .75

New Cross:

.00 11.71 2.16 30 73 .39

Here, n is the number of weeks in a row that the close must be less than the moving average. Note that each stratum includes those above it (e.g., 4 includes 4, 5, 6... 9).

Interestingly, it seems that a much better predictor of future price movement is the number of closes ABOVE a moving average:

Over the next 12 weeks:

n closes

above: Profit: PF: Trades % prof. Avg / trade:

20.00 -3.55 .46 8 50 -.44

19.00 -2.28 .61 9 56 -.25

18.00 -1.13 .80 9 56 -.13

17.00 4.79 2.31 9 78 .53

16.00 7.31 3.71 10 80 .73

15.00 6.28 3.02 12 67 .52

14.00 9.14 3.40 12 67 .76

13.00 11.35 5.44 14 71 .81

12.00 16.43 8.93 14 64 1.17

11.00 22.30 19.72* 14 71 1.59

10.00 22.72 15.20 15 73 1.51

9.00 24.33* 17.86 15 73 1.62*

8.00 20.20 16.06 16 69 1.26

7.00 20.33 10.76 17 76 1.20

6.00 18.83 19.19 17 82* 1.11

5.00 21.41 10.30 19 74 1.13

4.00 4.30 1.28 21 67 .20

3.00 6.51 1.42 23 70 .28

2.00 16.66 3.29 23 74 .72

1.00 17.99 4.48 24* 75 .75

New cross:

11.71 2.16 30 73 .39

Note that 9 weeks seems optimal and that if too many closes have passed since the moving average was crossed, the odds of it being profitable in the future diminish.

Over the next 4 weeks:

n closes

above: Profit: PF: Trades % prof. Avg / trade:

20.00 2.65 2.24 8 63 .33

19.00 3.81 3.00 9 56 .42

18.00 2.49 2.09 9 67 .28

17.00 10.17 7.19 9 67 1.13*

16.00 5.49 7.56 10 60 .55

15.00 6.70 3.82 12 67 .56

14.00 6.73 4.87 12 75 .56

13.00 10.85 18.58 14 86* .77

12.00 7.24 9.12 14 57 .52

11.00 14.01 14.34 15 60 .93

10.00 16.14* 32.71* 16 75 1.01

9.00 12.22 6.71 17 65 .72

8.00 7.90 2.74 18 61 .44

7.00 6.39 2.79 19 68 .34

6.00 .45 1.12 20 75 0.02

5.00 .73 1.15 22 73 0.03

4.00 -6.48 .53 28 54 -.23

3.00 -13.07 .33 35 49 -.37

2.00 -5.11 .73 37 59 -.14

1.00 7.78 1.74 40 60 .19

.00 8.40 1.59 48 69 .17

S&P500, 2/88 - 11/98:

Over the next 4 weeks:

n closes

above: Profit: PF: Trades % prof. Avg / trade:

20.00 22.64 2.44 4 75 5.66

19.00 59.01 7.37 6 67 9.84

18.00 69.65 9.40 6 67 11.61

17.00 87.42 6.40 7 71 12.49

16.00 108.43 13.67 7 71 15.49(*)

15.00 37.70 2.33 7 57 5.39

14.00 60.48 2.63 8 63 7.56

13.00 5.50 1.10 8 50 .69

12.00 -50.56 .51 11 45 -4.60

11.00 -6.80 .91 12 50 -.57

10.00 31.53 1.80 13 54 2.43

9.00 107.97 3.92 14 57 7.71

8.00 5.41 1.03 19 63 .28

7.00 47.46 1.25 20 55 2.37

6.00 24.15 1.11 20 60 1.21

5.00 114.45 1.67 24 50 4.77

4.00 146.73 2.30 27 63 5.43

3.00 253.86 3.14 30 67 8.46

2.00 477.06*8.01* 32 75* 14.91*

1.00 326.25 3.62 35* 60 9.32

No closes above the moving average:

526.33 7.68 39 74 13.50

Note that for the S&P500,

- this indicator reduces total profitability and with few exceptions (2 weeks, 16 weeks), the next 4 week profitability is worse than those weeks immediately following a moving average crossover from below;

- if the indicator is to be used, a 2 week window seems best; I would not trust the more extreme values; however, given the volatility of the total profitability as you increment the parameters, I would not put much stock in this indicator.

For the next 12 weeks:

n closes

above: Profit: PF: Trades % prof. Avg / trade:

20.00 43.00 4.99 4 50 10.75

19.00 27.27 1.60 6 50 4.54

18.00 2.44 1.03 6 50 .41

17.00 108.84 6.82 7 86 15.55

16.00 105.31 264.28 7 86 15.04

15.00 151.88 26.19 7 86 21.70

14.00 155.26 3.65 8 75 19.41

13.00 164.70 8.44 8 75 20.59

12.00 85.44 2.09 11 73 7.77

11.00 137.09 2.39 12 75 11.42

10.00 132.48 2.46 13 69 10.19

9.00 167.41 2.58 14 71 11.96

8.00 182.75 1.99 19 68 9.62

7.00 80.02 1.33 19 58 4.21

6.00 104.33 1.38 19 63 5.49

5.00 185.20 1.84 20 70 9.26

4.00 191.71 1.97 20 55 9.59

3.00 331.03 3.82 20 70 16.55

2.00* 433.73 4.41 20 80 21.69*

1.00 401.31 3.24 22 68 18.24

Fresh crossover:

496.97 4.66 23 78 21.61

Again, 2 weeks adds some value, but not much. The best time to invest is just after the moving average has been crossed to the upside (after last week's close was below it).

Now, reverting to the number of closes BELOW the moving average, where the count must be at least n, then cross over, for the next 4 weeks:

n closes

above: Profit: PF: Trades % prof. Avg / trade:

10.00 10.98 100.00 1 100 10.98

9.00 52.36 100.00 2 100 26.18

8.00 31.20 100.00 4 100 7.80

7.00 31.20 100.00 4 100 7.80

6.00 38.67 100.00 5 100 7.73

5.00 134.68 100.00 7 100 19.24

4.00 155.71 7.93 11 82 14.16

3.00 200.67 9.93 17 88 11.80

2.00 346.22 9.87 25 72 13.85

1.00 540.84 7.99 39 74 13.87

Now we have a reliable indicator. For the S&P500, as the number of weeks below the moving average increases, the average percentage profitability of the next 4 week period tends to increase also. In addition, up to week 5, the profitability over that 4 week period remains high (and climbs again at week 9). Note that 100% of all times the market rose below its 12 week moving average when the close had been below that average for at least 5 weeks the market was higher 4 weeks later.

For the next 1 week:

The next question is whether the crossing of a short-term moving average has predictive value for the next 1 week:

n closes

above: Profit: PF: Trades % prof. Avg / trade:

12.00 -.74 .00 1 0 -.74

11.00 30.98 42.63 2 50 15.49

10.00 30.98 42.63 2 50 15.49

9.00 -41.92 .43 3 33 -13.97

8.00 -16.15 .72 5 60 -3.23

7.00 -16.15 .72 5 60 -3.23

6.00 -14.83 .74 6 67 -2.47

5.00 45.19 1.78 8 75 5.65*

4.00 44.14 1.68 12 75 3.68

3.00 79.55 2.15 19 79* 4.19

2.00 122.40 2.12 31 65 3.95

1.00 248.62 2.71 53 72 4.69

This is a strange and spotty table, but overall it shows that up to about 5 weeks, there does seem to be a benefit to knowing that n number of closes were below the moving average. I have excluded the more extreme values since they made little sense (weeks 10 and 11 were profitable, but the others weren't ??).

No comments:

Post a Comment