Saturday, 15 February 2014

Using a Monte Carlo Simulation to Measure Portfolio Performance

Clever or Lucky?

As I mentioned in last week's post, I am interested in the question as to whether the impressive performance of the Mechanical Bull (MB) portfolio is the result of a clever investment technique or whether I have simply been lucky. In this post I have done some analysis to try and answer that question using a Monte Carlo simulation.

Wikipedia describes Monte Carlo methods as:

"... a broad class of computational algorithms that rely on repeated random sampling to obtain numerical results; typically one runs simulations many times over in order to obtain the distribution of an unknown probabilistic entity"

This technique can be applied to answer my question. The idea is to take the full set of stocks from my investment universe, select a corresponding time frame, create portfolios at random, and then calculate an average return for each portfolio. The full set of returns then provides a distribution against which the performance of the MB portfolio can be measured. This can be used to tell me whether I am clever or just lucky.

Backtesting data

To do this experiment I needed a backtesting database. I used Sharelockholmes, for no other reason then I have used it extensively in the past and the cost of renewing my subscription was affordable (£5.20 a month). There may be better such databases out there, but I did not bother to investigate this further.

Sharelockholmes allows you to select a point in time at each quarter and then see how selected UK stocks would have performed over selected future time periods. Since I started the MB portfolio on 24 May 2013, I could not test its performance from the outset. The best I could do was to start from 30 June. Likewise, the way subsequent performance is reported is constrained and so the testing period stops at 31 December. This gave a total test period of six months. The MB return over this period was 31.6 per cent.

Issues to sort out

A common issue with backtesting is company delisting, which for Stockopedia means that the forward performance metrics are missing. There were 43 such stocks in my dataset. I tackled this by searching each of these stocks manually and then identifying the last price at which the stock traded. In some cases this might not have reflected reality, for example, if the stock was suspended and shareholders were later wiped out. However, in one case (RSM Tenon) I remembered what happened so I recorded a nil return.

I also noticed some other problems with the performance mertics. For example, Ixico showed a 6 month performance gain of 4240 per cent! Some quick research revealed that the company has a reorganisation of share capital as the result of a reverse takeover, so these figures were not reliable. I readily concede that there may be other errors in the data and as such this experiment may not perfect. However, I simply did not have the time or patience to investigate these further.

Running the simulations

Once I had a full set of performance metrics, I generated portfolios based on a random selection of 15 stocks, which is the same number that I hold in my MB portfolio. I did this in Excel by adding a random number column in the spreadsheet, which I then sorted to generate a new portfolio and an average return metric for each. I repeated this 100 times thus providing 100 hypothetical return values.


The Results

The average return from each of these simulations was 9.4 per cent. This compares with the FTSE Allshare return of 9.7 per cent (sourced from Google Finance) over the same time period, so this seems about right. But the real point of doing all this was to get an estimate of variance, or the degree to which the simulations vary around this average. Now clearly, the MB return of 31.6 per cent is much better than 9.4 per cent, but how can I be sure that this is not just down to luck? The higher the variance, the more difficult it is for me to claim to be clever rather than lucky.

The standard deviation is a useful measure of variance as this can be used to construct confidence intervals, which are a commonly used framework for hypothesis testing, For the data I generated the standard deviation was 10.4 per cent. I am not going to do all the maths, but in lay person's terms this all means that we can be 95 per cent confident that the out performance of the MB portfolio over this period was due to something other than luck.

It is important to note that this test does not say anything about the level of out performance. All this is saying is that the MB portfolio is very likely able to deliver out performance. So with a 31.6 per cent return over this period, perhaps I have been both clever and lucky!









Saturday, 8 February 2014

Mechanical Bull Portfolio February Update

It has been almost two months since my last update so apologies for that. I have been very busy with other things, so just as well the MB strategy doesn't require much investment in time!

There were two drop-outs in December, with Creston & Terrace Hill Group meeting the sell rules. These were replaced by Sweett and Renew. The latter is already up by over 20 per cent in less than two months. Sweett was up over 15 per cent  at one point but dropped right back. In January Micro Focus International was replaced by VP, which hasn't done much as yet.

Overall the portfolio continues to increase in value at a blistering pace, up almost 37 per cent since May 2013. This is an annualised rate of over 50 per cent.

One of the things I would like to explore further is the extent to which this kind of out-performance could be down to chance, or whether this strategy will always tend to out-perform. I suspect it is latter, but what level of out-performance would be "par"?

The general area of statistics dealing with such questions in known as Monte Carlo simulations. These do not seem to be written about that much within the blogosphere or popular literature. However they seems to me to be of fundamental importance when evaluating the effectiveness of different investing strategies. It really grates when I read about someone's portfolio being up x per cent over the year, when in fact, the benchmark index is up by a similar amount. I would be more impressed with an approach that delivered zero returns against a sharp drop in the index. Context is everything.

This is something I might try to write more about further in a future post.








Thursday, 12 December 2013

Mechanical Bull Portfolio

In this post I present the current status of my Mechanical Bull portfolio which I set up on 24 May 2013 with an initial investment of £30,000. This is not my real-life portfolio. I am constantly adding cash to my real-life portfolio, which complicates measurements of performance. However, I use the same buy and sell principles and I have interests in 12 out of the 15 stocks currently held in the portfolio below. The only stocks I don't currently have an interest in are Keller, Matchtech and Microfocus International. The reasons are mostly just down to timing. For simplicity's sake I exclude trading costs, but I also exclude dividend payments. I believe this to be a conservative approach, which if anything should slightly underestimate actual performance.

The portfolio has increased in value by 29% since inception, which is annualised rate of over 52.5%. The FTSE AllShare has fallen by 2.3% over the same period. I see this level of performance as exceptional and I do not expect it to continue. Still, it appears pretty solid with 75% of past and current stock showing gains. The overall overperformance has not been driven by just a couple of stocks, which gives me a fair degree of confidence in the approach. I will update this spreadsheet every month around the 24th of the month when I will usually make my trades.

Creston and Microfocus International are currently in line for the chop. Creston had a disappointing set of results last week while Microfocus have just drifted down in the MB scoring stakes. Interserve and Kentz are looking likely purchases in the lead up to Christmas. I have bought and sold Interserve twice (in real life) since early 2011, making a small profit each time. The second time I sold was in August this year as a result of following my current strategy. So, there is a natural resistance to buying in again when the price has jumped up further. I also currently own Kentz in my real-life portfolio. It has done pretty well is now my second most valuable holding.
 

Mechanical Bull Portfolio as at 12 December 2013


Sunday, 8 December 2013

The Mechanical Bull Method

An idea rooted in Stockopedia

Until now, this blog has been laying the groundwork for my investment philosophy. In this post I will provide the nuts and bolts of my investment method. In essence it is very simple. However, it will be very difficult to understand without reference to some particular features of the Stockopedia website. So if you haven't already please read the following post.

As I have mentioned, there are two features about the Stockopedia website that I find particularly intriguing. The first is their idea of the 'Screen of screens'. This takes the 60 or so 'guru' screens and counts the number of times a particular stock appears in each screen. The idea is that a stock that appears across multiple screens is displaying strengths across a number of criteria. These stocks are interesting because they may be considered by investors with very different investment approaches.

The second feature is their recently introduced StockRanksTM. This is calculated by first ranking stocks in terms of quality, value, and momentum using a number of different metrics. These ranks are then compiled into a composite rank of these three factors. As I have mentioned previously, I believe that this kind of approach is better than screening, because a screen will sift out stocks that are weak on only one criteria, whereas rankings are more forgiving of any particular weakness.

The 'Superscreen'

It seems to me that both approaches are using different methods to achieve the same basic objective, that is, to find stocks that are attractive from a number of different angles. This got me thinking about an approach for combining the Screen of screens with the Stockranks to produce some kind of 'Superscreen'. Where you get a similar answer following two different methods, you should have more confidence in your results than if you only follow one.

My method for doing this is childishly simple. The Screen of screens is a simple count with the highest count typically between 8 and 10. StockRanks give each stock a composite value of between 0 and 100. There is only stock with a value of 100, about 20 with 99, about 20 with 98 and so on. My method for combining the two approaches is to to simply add the two value together. Here are the results all those with a 'Superscreen' score of over 100 as at 8 December 2013:


Ticker Name # Screens (Long) Stock Rank™ Superscreen score
RM. RM 6 99 105
RNWH Renew Holdings 6 99 105
DTG Dart 7 98 105
TT. TUI Travel 7 97 104
FRP Fairpoint 4 99 103
CHRT Cohort 4 99 103
VP. VP 5 98 103
JD. JD Sports Fashion 5 98 103
ATK WS Atkins 5 98 103
KENZ Kentz 6 97 103
TRI Trifast 3 99 102
NWF NWF 3 99 102
STCM Steppe Cement 3 99 102
THG Terrace Hill 3 99 102
CAMB Cambria Automobiles 3 99 102
MTEC Matchtech 4 98 102
HFD Halfords 4 98 102
RCDO Ricardo 5 97 102
IRV Interserve 6 96 102
CDY Casdon 2 99 101
HYDG Hydrogen 2 99 101
MCM Motivcom 2 99 101
NWS Smiths News 3 98 101
TOT Total Produce 3 98 101
STAF Staffline 3 98 101
CSG Sweett 5 96 101
BKG Berkeley 5 96 101
TNI Trinity Mirror 6 95 101


Effectively, what I am doing is using the Screen of screens to sift out the most promising Stockrank candidates in the high 90s.

Trading Rules

In terms of translating this screen into an executable strategy. The buy./sell rules are as follows:

1. New buys are restricted to the top half dozen or so stocks. If I were starting form scratch at this moment I would buy equal amounts of all stocks with scores of over 103.
2. Accumulate for any existing stocks with a scores of over 100.
3. Hold for any stocks with scores 90-100.
4. Sell when score drops below 90.
5. Look to hold between 15 and 20 stocks.

I generally look to make all my trades on the same day about once a month. The precise day varies for practical reasons that have to do with taking advantage of reduces trading commissions. I do not try to time my trades with any trends in either particular stocks or the broader market. This is all part of a deliberate strategy of 'strategic ignorance'.

Does it work?

I have been implementing this strategy since 24 May 2013, that is, for just over six months. The strategy has returned 27.6% during this period compared with 19.5% for the standard Screen of screens. The FTSE All share is virtually unchanged over this period (down 0.2%) although the FTSE250 is up 6.4%. This is not long enough to provide definitive proof of this being an effective strategy. However, the results to date are certainly very encouraging. I will aim to do a bit more analysis of the performance of the strategy portfolio in future posts.
 







Tuesday, 26 November 2013

The Importance of Self Reliance

Apologies for not posting for a while. My father passed away last week and so I have been rather pre-occupied with other matters.

This has been a period of intense reflection about my father and his life, which was quite extraordinary in many ways. He was a self-made man who started with almost nothing. He was both a very compassionate man, but also a hard worker who stressed self-reliance. It was a theme that featured prominently at his funeral and so I thought that this theme of self-reliance was worthy of a brief post.

The managed funds industry obviously likes to encourage investors to put money aside for a rainy day. However, in many respects, they abhor the notion of self reliance. Investing directly in the stock market is too difficult for ordinary investors - best to leave it to the experts. Oh and by the way, that so called expertise comes at a price, so be prepared to pay up, even if your investment fund under-performs the market.

Actually, investing in managed funds  is not necessary. Any, reasonably intelligent private investor with a clear strategy and discipline should be able to invest and outperform managed funds. This is because managed funds are, due to their size, dominated by large caps that are constantly being scrutinised. Thus opportunities to take advantage of mispricing are pretty low. In contrast, smallcaps offer more mispricing opportunities, Furthermore small private investors have a structural advantage over managed funds as they are able to build a stake in small caps without affecting the share price.

My father dabbled in the share market although he made most of his money through property investing. In any case, I think that his values around self-reliance are very similar to the basic theme of this blog. Don't trust anyone who is trying to get a slice of your hard-earned savings. There is not reason that you can't do this yourself. Start reading, develop a strategy that suits your skills and temperament, implement the strategy and most importantly, stick with it!

Sunday, 10 November 2013

Review of Stockopedia

Stockopedia is  a UK based stocks and shares information service. There is some basic information available for free and a subscription is required to access the premium content. It currently costs £19.95 a month to access all their data on UK stocks. Is this worth paying for?

In a word, yes! Although ultimately all the underlying information is public data, Stockopedia does an excellent job of organising this information so that you can quickly make sense of it. Every UK listed stock has a raft of colour coded indicators and metrics. There are a range of different valuation tools that you can tweak to your hearts desire. There are also a host of different charting tools and metrics. Whatever you investing style, there are are a set of visually informative and easy to use tools to help you.

Stock screening

While all equities information services these days offer screeners, Stockopedia's is the best I've come across. It has a huge range of screening parameters and you can either create your own or 'fork' a pre-cooked screen from one of more than 65 guru screens. So if you want to emulate your favourite investment guru, Stockpedia makes it easy.

Stockopedia have also created their own unique guru screen called the "Screen of Screens". This counts the number of times a particular stock appears on any of the other long guru screens. This is an interesting idea as it highlights stocks that are attractive from a number of different angles. A hypothetical portfolio based on this screen has returned 77 per cent since the December 2011 compared with about 24 per cent for the FTSE 100.

StockRanks

In the last couple of months, Stockopedia have been experimenting with something they call "StockRanks". These are composite metrics for four broad factors, namely value, quality, growth and momentum. For example "value" combines six different valuation metrics namely: P/E, P/S, PBV, PFCF, earnings yield, dividend yield. Stocks are ranked in these score with 100 for the top scoring stock down to 0 for the lowest. Each of these ranking factors can then be combined depending on your investing style.

Initially, Stockopedia combined all  four ranking factors into a single composite score. However, their preferred composite measure now omits growth, just combining quality, value and momentum. Their research has established that there is a tendency to overpay for growth. Therefore, it is not a strong predictor of future share price movements.

More thoughts on Stock Ranking

I think that stock rankings are better than screens. A stock screener is essentially a checklist and if a share narrowly fails just one test, then it is screened out even if it scores very strongly on other criteria. Thus, stock screening will tend to leave some good candidates hidden. Ranking methods allow stocks to be weighted so that some moderate weakness in one criteria will not necessarily override strengths in others. Thus stock screens are quite blunt instruments, while stock rankings offer more careful calibration.

This idea of ranking stocks across multiple dimensions is key to my investment appoach. Greenblatt's argues that although his Magic Formula does not work all the time and the investor just needs to be patient. However, this doesn't seem completely satisfactory. If you are going to take a mechanical rules based approach to investing, it seems reasonable to aim to have something that works, if not all the time, then at least as often as possible.

The stock market goes through phases where certain investment styles do better. Over the last few years, value investing has performed better than quality based approaches. Momentum approaches have done particularly well in 2013. However, rather than trying to guess which style is going to do well in future, why not select stocks that have a number of strengths that should do well regardless of what particular style is performing best at the time? Stockopedia's StockRank does exactly that and therefore this is now the main basis on which I select stocks.

Back-testing

The only slight quibble I have with Stockopedia is the lack of any back-testing feature. The reasons given are that historical data are either unreliable or prohibitively expensive. However, some back-testing functionality may become available over time as Stockopedia build up their own data.

I went through a phase of doing a lot of back-testing for which I used Sharelock Holmes. This is what got me thinking about the limitations of stock screening and that some kind of weighted method on key metrics would work better. I didn't really pursue it as I didn't know how to go about it. Now that I have come across StockRanks, my conclusion is that these are going to be pretty hard to beat in terms of any mechanical rules based investing so back-testing seems like less of a priority.

Closing thoughts On Stockopedia

I really like the philosophy of Stockopedia. They are geared towards the DIY investor and do a great job at de-mystify equity investing. Why pay fees to fund managers, very few of whom consistently beat the market when for a modest fee you can access information and tools that give you every chance of doing better? Stockopedia has become my main source of information on UK stocks and I would be lost without it.

If you want to try it out go to the Stockopedia website.


Sunday, 3 November 2013

Joel Greenblatt's Magic Formula

Introducing Greenblatt

I am keen to kick on and set out my investment manifesto. However, before we get to that I need to provide some more context.

Like musicians, investors are influenced by the greats that have come before them. Joel Greenblatt was influenced Warren Buffett who in turn was influenced by Ben Graham. From my first two posts you've probably guessed that I am a fan of Warren Buffett. Show me a private investor who isn't?

However, for me Joel Greenblatt is my single biggest influence.

The Little Book that Beats the Market 

Greenblatt's The Little Book that Beats the Market sets out in layman's terms the investment philosophy he used when running the hedge fund, Gotham Capital. Apart for being short (less than 150 pages), its written in a 'self help' style, full of whimsical anecdotes, like those self help books written in the 1930s by the likes of Dale Carnegie and Napoleon Hill.

Although a bit annoying in parts, Greenblatt does a good job of getting across the point that successful investing boils down to basic principles and discipline. In essence the advice is to buy great companies at bargain prices. While those words could have come straight from the mouth of Buffett, what Greenblatt does is to set out a mechanical approach for selecting stocks and managing a portfolio.

He selects stocks based on something he calls his  "Magic Formula". In very simple terms he uses earning yield as a  measure of value and return on capital employed (ROCE) as his measure of 'quality'. He ranks the universe of investable stocks on each these criteria and then adds them together. Stocks are then selected from the thirty or so lowest scoring stocks.

There is a good summary of "Magic Formula Investing" over on Stockopedia if you want to read more.

Does the Magic Formula work?

Greenblatt claimed that the MF is capable of making abnormal returns of up to 30% pa. However, independent testing has struggled to get anywhere near that. For example, over at Stockopedia the performance of Greenblatt MF screen has struggled to keep up with the FTSE 100, and currently ranks 50 out of 60 'guru' screens in terms of annualised performance.

There are a number of theories for this. Something I read a while back on a U.S. blog is that in recent years the MF has tended to flag up Chinese reverse take-over stocks that have mostly tanked. Ed Croft of Stockopedia has documented research by Wes Gray and Tobias Carlisle that suggests that the MF has a tendency to systematically overpay for quality. My own theory is something actually mentioned in the foreword of "TLBtBtM", which is: if lots of people start following a certain investment strategy then returns will diminish. I think that simplest explanations are most usually correct.

The MF is certainly the best known systematic/mechanical strategy around although I have no idea how many people are actually using it. I subscribe to a Yahoo group on MF Investing and if the recent postings, or rather lack of them, are anything to go by then it certainly seems like interest in the MF is waning.

Greenblatt himself says that the MF goes through phases when it doesn't work as well and that the trick is to be patient and wait for the inevitable upturn in performance. Interestingly, the Greenblatt MF screen on Stockopedia has had a bit of a surge recently increasing 14 per cent in the past 3 months. So, perhaps investors have given up on MF investing at just the wrong time?

Trust the Quant

Although I am inspired by Greenblatt I have reached the conclusion that his approach is not for me. First of all, I don't believe that following a well trodden path is an optimal strategy - its got to be better to seek an angle that fewer people are following.

Secondly, it seems to me that there has got to be better ways of identifying cheap stocks at good prices". Stockopedia have developed a more sophisticated approach for ranking stocks in terms of value and quality. For example, their method for ranking value uses earning yield with five other valuation metrics. That has got to give better results than just one.

However, the thing I do like about Greenblatt are the wonderfully simple things he has to say about mechanical investing. The idea of buying a stock and holding it for a year, The idea of buying and selling just once a quarter. The idea of selecting candidate stocks at random, rather than trying to apply additional discriminatory criteria. His overriding philosophy is to "trust the quant".

This is such a great mantra. My worst decisions always seem to be when I am panicked or acting impulsively. Learning to "trust the quant" is a way of allowing the intellect to subjugate those emotions that make us do stupid things. It is something I should start repeating to myself everyday!