# A Mathematical Approach To Stock Investing

|
Includes: SPY
by: Tiger Technologies

There are several approaches to investing in the stock market; the traditional methods like fundamental analysis, technical analysis, indexing and the more modern techniques like systematic or algorithmic trading. But there is one thing common across all of these techniques: the reliance on past patterns to predict the future.

A fundamental analyst believes that a stock will repeatedly react the same way as it has in the past to earnings reports, product introductions, etc. Similarly, a technical analyst believes that the moving averages and Bollinger Bands will continue to predict future stock movement as they did in the past. And the modern day, systematic investor believes that his mathematical algorithms will be able to identify patterns from the past and predict future price movements based on those historical patterns.

This approach, that relies on past performance or past patterns to predict future movements, is called autocorrelation. It is explained in greater detail in the paper on our website, but it essentially measures how similar a given time series is with a lagged version of itself over successive time intervals.

A Working Example of Autocorrelation on the S&P 500 (1950-2012)

In the complete paper I have shown that autocorrelation exists in the stock market, the question now is how to spot it and utilize it to make money.

Assume that you were a mathematically inclined investor analyzing the S&P 500 in 1970. If you looked at the past two decades of daily S&P 500 data, and segmented the data based on the move following a positive day and the move following a negative day, you would have seen that there were 54% positive days and 46% negative days in all. But, you would have also noticed that if the S&P 500 was positive on any day, the probability of the next day being positive as well was higher than 54%. In fact it was higher by a significant amount at 61%.

Source: Yahoo Finance, MA Capital Management.

Conversely, if the S&P 500 was negative on any day, then the probability that the following day's move was also negative increased dramatically as well, from 46% to 55%.

Source: Yahoo Finance, MA Capital Management.

Both the above statistics showed a marked degree of a trend or autocorrelation. Meaning that yesterday's signal contained statistically significant information about today's signal.

This is interesting, because in a truly random process, today's event should bear no information on tomorrow's event. Therefore, if the stock market is random, the percentage of positive days should be no different from the base case, regardless of what happens on a given day. Most mathematical algorithms look for the slightest hint of autocorrelation, but in the 1950-1970 time periods, this autocorrelation in the S&P 500 was quite high.

Armed with this data, an astute trader could very easily devise a simple trading strategy whereby he goes short at the end of any down day and long at the end of any up day. This simple strategy would have yielded the following returns:

1950-1970

S&P 500: 7.5%/year

Algorithm: 30.2%/year

Source: Yahoo Finance, MA Capital Management (Data for the S&P 500 are the closing prices of the S&P 500 index. The annual numbers are the addition of daily returns and do not include dividends).

But this is still backward looking as I had the benefit of first researching the behavior of S&P 500 from 1950-70 and then applying a trading strategy on that data by going back in time to 1950. As I cannot go back in time, what if this simple strategy had been applied from 1971-2001? What if I had confidence that the behavior of the stock market from 1950-70 would continue into the future as well.

The result of that experiment would also have yielded returns that would have significantly trumped the S&P 500 over this 30-year period as well.

1971-2001

S&P 500: 8.2%/year

Algorithm: 20.9%/year

Source: Yahoo Finance, MA Capital Management (Data for the S&P 500 are the closing prices of the S&P 500 index. The annual numbers are the addition of daily returns and do not include dividends

Did this pattern continue into the present? No, it did not. While the S&P 500 returned 2.0%, the algorithm lost 21.7% on an annualized basis. In fact the pattern completely changed over the past decade.

2002-2012

S&P 500: 2.0%/year

Algorithm: -21.70/year

Source: Yahoo Finance, MA Capital Management (Data for the S&P 500 are the closing prices of the S&P 500 index. The annual numbers are the addition of daily returns and do not include dividends

1950-1970 (Shows trend, as a positive day is followed by a higher probability of a positive day)

2002-2012 (Shows counter-trend, as a positive day is followed by a higher probability of a negative day)

The point is that stock price movement is not a random process. Autocorrelation exists, it can be significantly higher or lower than 0 but changes with time. Some signals can persist for decades with varying strength while others only last for a few days at best.

With sophisticated mathematical tools, the autocorrelation signals as well as the signal strength can be detected and even predicted. This can be a useful tool in trading and even portfolio management.

Disclosure: I have no positions in any stocks mentioned, and no plans to initiate any positions within the next 72 hours. I wrote this article myself, and it expresses my own opinions. I am not receiving compensation for it (other than from Seeking Alpha). I have no business relationship with any company whose stock is mentioned in this article.