Monday, July 5, 2010

Designing a portfolio using EzBacktest

Let's start by a simple question. Imagine that you (a) had money, (b) it's all in cash, (c) wish to invest it all. OK - what should you invest in? Well - it's frankly none of my business and will not advise you on what you should do in that regard. But for the sake of argument, let's say you choose out of the blue a few companies you know and trust, and wish to quickly review how investment in these companies over several years would look like. For example, let's pick a few:

McDonald's (MCD), Wallmart (WMT), Netflix (nflx), Intel (INTC), Apple (AAPL), Teva (TEVA)

That's a nice pack IMHO, somewhat diversified across industries, brings some dividends, has some growth, some staples and the best part as far as I'm concerned - these are all big companies I know and interact with on a daily basis. For most of you this is also true. You take lunch brakes at Mickey-D, shop on a budget at Wallmart, dumped the video store for Netflix, use a computer, talk on your iPhone and medicate yourself with Teva products. OK, enough justifying the picks. Let the pros sort fundamentals and the traders care about charts. This isn't my goal in this post.

Open EzBacktest and type each ticker, click the 'down' button to move to next line even if it isn't there, or tab/right button to fill in a percentage allocation:

Now click F8 to distribute the allocation equally (as shown above) and F5 to run a quick test. (you will need to wait for Yahoo quotes to download historical data for all equities in the portfolio)
Not a terrible result at all. To get a better big picture, go back to the portfolio editing window and change the 'Months to test' to 120. Click F5 again (or 'Back Test' button).

Wow Nelly - that's impressive. Click on 'Show declines' checkbox and uncheck 'Show Legend'
Note that the starting date is after the requested date. The software will truncate to the first available date for each equity in the portfolio. In this case, Netflix is the latest to go public.

OK, so now I'm looking at this portfolio and observing its bigger declines and I'm thinking - would I have held long during these scary days. Especially if I had bought at the highs and watched my savings shrink by 30%, 19.5%, or 35%. Ask yourself this question, would you? I'm pretty sure I wouldn't have. While on first glance this portfolio seems inviting, it is very volatile and risky. Sure the end result kicks the S&P 500 - but it is only in a back view mirror. One cannot tell where tomorrow may lead, and it is imprudent to wily-nilly play with graphs and buy risk with your life savings.

I'll go back to the portfolio editing window and will try to reduce my risk. To do so, I just add:

Intermediate term treasury bonds ETF (IEF), and least risky short ETF (SH).

I readjust the allocation manually this time to achieve:
MCD - 7, WMT - 7, NFLX - 7, INTC - 8, AAPL - 8, TEVA - 8, IEF - 40, SH - 15

Hedge and income in a second, click F5 and get the following graph:
Note this time the graph begins somewhere in 2006, when SH first became available. If you take a peek at the right side of the window you'll notice few statistics, pay attention to 'Sharpe Ratio'. In this case it is 2.24, compare it to the first graph at 1.24 (where no hedging was added and equity allocation was distributed equally). Over the last few years - most portfolios yielded much worse 'Sharpe Ratio' - which is a measurement of risk/return. In our case, an annualized return of 15.6% with risk of 6.4 standard deviation gives us an almost fictional risk return ratio of 2.24. I'm sure I'd be happy had I invested in this portfolio years ago - I didn't.

Let's save this portfolio quickly, first - type a title: 'hedged tutorial 1', now click the save toolbar icon. A save file dialog will appear - and will allow you to have different file name than title.

Let's continue our voyage here. From the menu, pick tools and select 'show status log'. As you can see, SH is preventing us from verifying our portfolio over a longer period of time. Since there aren't any ETF-s from earlier periods which provide 'short' opportunities, I'll switch SH to SHY. SHY is short term treasury ETF and will simulate cash for this tutorial. Instead of shorting, we will hold cash.

Change SH to SHY and click F5.

The resulting graph (not presented here), provides us with more history. The Sharpe ratio is 1.51, the annualized return is 15.0%. Not much worse. Declines are a bit steeper, at most 14.6% during the Lehman brothers crash.

Change the title to hedged tutorial 2, and from 'File' menu select 'Save As'. Save as a new file name as well.

Moving on, now we have at least two portfolio files in our documents folder. We can compare the two. From the 'Tools' Menu, select 'Compare Portfolios'. On the new screen, double click on portfolios you wish to compare, or select and click on the 'move to the right' UI button. Add the two tutorial portfolios and click 'Begin', or press F5.

Review the comparison tabs. Note that in 2008, the year of the crash, the 'short' hedged tutorial portfolio returned 4%, while the cash-hedge portfolio lost -0.1% .

Hope this was useful, enjoy - spread the word and don't be shy to reciprocate at the tip jar.

Download EzBacktest here.

No comments:

Post a Comment