Beating the sharemarket

One of my geeky hobbies is mathematical modelling. I did it with Greenhouse gasses to predict warming, and now I have tested a little idea about the Stockmarket.

Sometimes you read an article by a clever financial guru who unlike the rest tells you that there is no magic formula for making money on the stock market - whatever assumptions you make, someone else will have already tried and failed with. If you pick winners from the past, then you will fail, if you try to pick shares that have bottomed out you will fail, and of course if you get in on a trend, you will probably have got on too late.
It is rather depressing, as the only other option is to give your money to superannuation funds and financial advisers, who will take out fees and lose it for you in a manner only a professional egotist could.

So with that in mind, I wondered if there is a strategy to invest in the stock-market, that does not require you to be reading the Financial Review everyday, and being less than 2 milliseconds away from making a trade when an announcement is made. There is one strategy that comes to mind, and that is just buy blue-chop shares and forget about them until you need the money. This has in general been a successful strategy for myself, as it does avoid the obvious pitfalls of being emotionally conned by the vagueries of the market, and just being content with the long term overall gains.
However, as you begin to take a little more interest, the obvious strategy that comes to mind is to buy in when the market is down, and possibly sell out when the market peaks.
It sounds so damn obvious and easy, yet obviously every amateur investor out there knows that this is the holy grail of investing. Obviously you should buy cheap and sell expensive, yet so many people end up doing the exact opposite, otherwise the sharemarket would be extremely boring!
The problem is that without knowledge of the future you don't know if the share market is at its bottom or at its peak. It is impossible to pick a peak or a trough while you are riding it, yet I wonder if mathematics can help us  by using the behaviours of the past to tell us when the sharemarket is overinflated and when it is worth buying in.

Using 115 years of data, I looked at the possible outcomes of applying a strategy whereby a linear trend for the past is used to determine how over-inflated or under-inflated the sharemarket is as any point in time. I then ran a simulation of buying in when shares were a certain fixed ratio below the trend, and selling when they were a certain fixed ratio above the trend. I found that it was difficult to actually beat the share-market. The performance of your portfolio was very dependant on the arbitrary figures one used to apply the strategy. In particular, the strategy was very sensitive to the number of years of history needed to determine the overall trend.

But after many permutations, I finally did come up with some numbers for my strategy that did give a very good performance of my share portfolio, that I invested fictitiously in 1915.
I found that I needed 25 years of history to get a good trend line, and that 5 years either way and the method failed. I found that it was best to sell only if the market was 80% over-valued, and the buy back in as soon as the market was back to trend. This strategy saw my fictitious portfolio stay in the market most of the time, except for a few "crash and burn" peaks where it managed to sell out just before a crash, and buy back in fairly quickly afterwards. The strategy worked for the reason that it kept the portfolio in the market almost all the time, and overall the market does go up most of the time. The strategy did not pick the crash at the GFC, as this was not preceded by a significant peak as other crashes were.

so here are the results:
ASX versus statistics

The modelling told me that a strategy of selling just before a crash and buying in afterwards is plausible but far from certain. The best bet is to stay in the game and wear a crash rather than being too scared of the turbulent waters. In 110 years, there was only 5 times that this strategy told me to sell, and this was followed by buying within a very short time. The strategy does not pick every crash.
The sensitivity of the strategy to the input variables - ie the number of years to use for trending, and the in/out ratios, is very informative that this investment strategy is not much more safer than the buy and ignore method which would have an investor most likely wear all the ups and downs of the sharemarket, but as this method is actually a winner, anything that may be better is also very likely a winner as well.

As a mathematical exercise, I would say it is a success, as an investment strategy, it is very flawed, but still better than feeding your money to sharks!

If your browser can load SVGs, then have a try yourself, and see if you can beat the sharemarket!

Useyears to determine background
UsePortfolio start year
Sell Out at% above background
Buy In at% below background

Make A Comment
Your Firstname
Your Surname
Your Email Address (will not be displayed)
Your Comment
Security Code
Enter Security Code (above)