# RSI(2) and the pre 80s Market

**The Average Investor's Blog » R**, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

In his detailed research on RSI(2) indicator, MarketSci emphasized several times that the contrarian strategies based on the RSI(2) indicator didn’t start working until the 80s. I remembered this observation recently when I observed another interesting anomaly …

In statistics, an important initial step in studying time series data is to consider the auto correlation of the series. In R, the simplest way to accomplish this is to use the acf function (for more details see Introductory Time Series with R). The R code to visualize the auto correlations is:

```
library(quantmod)
getSymbols("^GSPC", from="1900-01-01")
acf(diff(Cl(GSPC["2009"])), na.action=na.pass, main="S&P 500 - Correlation between Lags in 2009")
```

The result looks exactly “as expected”. There is no statistically significant correlation (the dotted lines) at any of the lags.

Imagine my surprise when I run the same command for the 1965:

Now there is a statistically significant correlation at lag 1! At this point I remembered MarketSci statement and decided to dig further. To make the long story short, for the most of the 60s and 70s, this correlation existed. I can hear some of you saying so what?

Here is what, a strong correlation in lag 1 means that the returns of the previous day are very predictable of the returns of the next day. In other words, I would expect a very simple strategy as **take a long position at the close if market is up or take a short position at the close if the market is down**, to perform quite well. This is like taking a heavily biased bet with the odds on the better’s side! Using some R code I quickly tested it and lo and behold, it seemed to work quite well! The detailed results would have to wait a next posting though …

**leave a comment**for the author, please follow the link and comment on their blog:

**The Average Investor's Blog » R**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.