The Average Investor's Blog

A software developer view on the markets

Archive for October, 2011

S&P 500 10 month MA action preview

Posted by The Average Investor on Oct 30, 2011

Monday is the last trading day of October. At the beginning of the month it was hard to foresee a position change at the end October, because the index would need to close a whopping 14.03% above the the close of September 30, 2011. Now, with one trading day to go, the impossible has become a reality, a close above $1,290.14, up only 0.39% from the close on Friday, will put the S&P 500 above its 10-month moving average.

The number on the SPY is a bit different. This ETF needs to close at or above $130.15, about 1.20% above Friday’s close, to end the month above its 10-month moving average. Not impossible, but certainly more unlikely.

Let’s see what tomorrow brings.


Posted in Market Timing | 2 Comments »

The Weekly Update

Posted by The Average Investor on Oct 30, 2011

It has been awhile since we had long positions to follow on the 20-week moving average, but here we are, with a huge single week gain, thanks to the jump after Europe promised to throw more money on a problem created by too much money … Amazing how these things work in “real” life (punt intended), isn’t it.

Helped by the huge move on Thursday, the S&P 500 ended up above its 200-day moving average.

Moving Average Position Since Gain
200 Day Long (SPY) 2011-10-27 -0.00%
20 Week Long (SPY) 2011-10-21 3.73%
10 Month Out (IEF) 2011-08-31 -0.83%

This is the first time I am using the above format, so some clarification is appropriate. First, from now on, I will be following only the S&P 500. For the long MA positions, I will be using the SPY to compute the returns, while for the neutral positions, I will be using the returns on IEF, the iShares Lehman 7-10 Year Treasury Bond ETF.

The format of the table on the right of the main article has also change. It will reflect the positions on S&P 500 based on various indicators.

Posted in Market Timing, Trades | Leave a Comment »

S&P 500 approaching the 200-day moving average

Posted by The Average Investor on Oct 27, 2011

With an agreement from Europe, backed by lots of money, tomorrow is likely to be a huge green day in the markets. In order to close above its 200-day moving average, the S&P 500 needs to close above $1,274.19, or +2.59%. Quite possible, if not tomorrow, certainly over the next few days (the breaking point is valid only for tomorrow, but it should be close to the right number anyways). From technical perspective, it starts to look more and more like we are done with the correction. Surprisingly, (tongue in chick) the fundamentals are pointing to the same conclusion.

Happy trading!

Posted in Market Timing, Strategies | 1 Comment »

The Weekly Update

Posted by The Average Investor on Oct 24, 2011

Although the mood seems to have changed, there were no major changes in the markets over the last week – the S&P 500 is the only index above its 20-week moving average.

However, as mentioned earlier, I am moving away from using exponential moving averages. For the time being I am planning to stick with simple moving average, and it was on Friday when the S&P 500 closed above its 20-week SMA (it did close above its 20-week EMA a week earlier). Thus, I will track this position using the SMA crossover.

There are a few changes coming, so stay tuned. In general, I am planning to keep track only of the S&P 500, but to extend the coverage using a few indicators on daily basis. Most of them, but not all, being moving averages. If you have any comments or suggestions – let me know.

Happy trading!

Posted in Market Timing, Trades | Leave a Comment »

R. I. P. EMA

Posted by The Average Investor on Oct 20, 2011

That’s right, I am moving away from exponential moving averages. Originally, I decided to use them somewhat arbitrary, probably because they tend to swing faster. Last night, after spending two and half hours debugging an issue which yet again turned out to be a particular property of these averages, I made my mind. I am back to simple moving averages and probably weighted moving averages for faster convergence.

What is the annoying property of exponential moving averages? They are recursive. In other words, each consecutive value is computed using the previous value. So what’s the problem? Here is an illustration:

library( quantmod )

getSymbols( "SPY", from="1900-01-01" )

spyEMA = EMA( tail( Cl( SPY ), 300 ), 200 )
print( as.numeric( last( spyEMA ) ) )

spyEMA = EMA( tail( Cl( SPY ), 400 ), 200 )
print( as.numeric( last( spyEMA ) ) )

Guess what the output is? That’s right – it’s different!

[1] 123.0065
[1] 123.4964

Not quite beneficial for trading research and since it has manifested on multiple occasions, it’s certainly time to move on.

Posted in R | 1 Comment »

The Weekly Update

Posted by The Average Investor on Oct 15, 2011

The last week lifted most markets around the world substantially. The gain on the S&P 500 was extraordinary – 5.93%. This steep advance to the upside, moved the S&P above its 20-week MA (as of the close on Friday).

S&P 500 with 20-week MA

The above chart reveals an interesting fact – the surge up was sufficient to penetrate only the fast 20-week EMA (the blue line), but not the 20-week SMA (the red line). Is it another whipsaw or a turn around? Only the future will tell, but based on the current chart, the re-entry is at a better level than the exit.

I will end the post with the code to generate the chart:

> library(quantmod)
> getSymbols("^GSPC", from="1900-01-01")
> png("~/ttt/sp500.png", width=480, height=320)
> chartSeries( to.weekly(GSPC), type="candlesticks", subset="2010/", theme="beige", name="S&P 500", TA=c(addEMA(20), addSMA(20)))

Posted in Market Timing, Trades | Leave a Comment »

Schannep’s out of the market too

Posted by The Average Investor on Oct 6, 2011

According to a recent update on MarketWatch, Jack Schannep is, as of the Monday close, again out of the market according to his interpretation of the Dow Theory.

Why on Monday and not earlier – one might expect that according to his interpretation, we would had a Dow Theory sell signal on September 22:

Status Date S&P 500 % Date DJI %
High 2011-08-31 $1,218.89 2011-08-31 $11,613.53
Bounce 2011-09-09 $1,154.23 -5.30% 2011-09-09 $10,992.13 -5.35%
Pull Back 2011-09-16 $1,216.01 5.35% 2011-09-16 $11,509.09 4.70%
Sell 2011-09-22 $1,129.56 2011-09-22 $10,733.83

Why the sell on the close of October the 3th? The explanation in my opinion is that the secondary reactions should last at least three weeks (according to a statement made by Robert Rhea, one of the early Dow Theorists). In other words, we need at least 15 trading days between the recent high and the bounce. This changes the table to:

Status Date S&P 500 % Date DJI %
High 2011-08-31 $1,218.89 2011-08-31 $11,613.53
Bounce 2011-09-22 $1,129.56 -7.33% 2011-09-22 $10,733.83 -7.57%
Pull Back 2011-09-27 $1,175.38 4.06% 2011-09-27 $11,190.61 4.26%
Sell 2011-10-03 $1,099.23 2011-10-03 $10,655.30

In any case, all long term indicators which have worked fairly well historically suggest staying out of the market at this point.

Posted in Market Timing | Leave a Comment »

Configuring R via .Rprofile

Posted by The Average Investor on Oct 2, 2011

For a while I have been looking for a way to load stuff automatically in R on each start (quantmod package, some options, etc). I had given up on solving it in a straightforward way, so I was delighted to find this post on R-bloggers!

Currently my .Rprofile is a two-liner:

library( quantmod )
options( width=120 )

Posted in Uncategorized | Leave a Comment »

The Weekly Update

Posted by The Average Investor on Oct 2, 2011

No new developments this week. The bear market continues pushing the world markets down. Despite a very strong start, the US indexes ended up a bit in the red for the week. Still above the August lows, but any bad news (and there hasn’t been lack of these lately) can easily move the indexes to new lows for the year.

The ARMA strategy has been long on the S&P 500 for the week, thus it also ended down -0.4%.

Friday was also the last trading day for September, quite an ugly month – the S&P 500 was down -7.18%!

Posted in Market Timing, Trades | Leave a Comment »

%d bloggers like this: