back testing final paper (2)

22
BUS 716 Portfolio Management Instructor: Phil McKnight Presenting Back Testing Strategies on Netflix and the NASDAQ By: Mitchel D. Fahey

Upload: mitchel-fahey-mba

Post on 18-Aug-2015

25 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Back Testing Final Paper  (2)

BUS 716 Portfolio Management

Instructor:Phil McKnight

Presenting Back Testing Strategies on Netflix and the NASDAQ

By:

Mitchel D. Fahey

Page 2: Back Testing Final Paper  (2)

What is back testing?

Back Testing is an important investigation of the history of a particular equity, index, commodity or asset class. It is a way of doing very in depth research into the history of how an underlying security trades with regards to parameters that a user sets up.

Take historical data by: daily prices, weekly prices, or monthly prices. You then go back as far as possible and get the actual data for the underlying security that one would want to trade or test. The user then picks key metrics that they want to test for. The user may use simple moving averages such as: 20-day, 50-day, 200-day simple moving averages, or exponential moving averages. Then test these ranges in a data series using excel or through a computer-programming algorithm. The trades are tested and then the data is poured through to see which metrics works best to predict when to go long, short, or get out of the underlying security.

Why is back testing important?

Back testing is immensely important because we need to know historical patterns for a number of reasons. We need to see how the underlying security performs in different economic scenarios as new ones are always arising and business cycles are always going to: start, end, or currently going on. We need to understand how geo politics, currency issues, commodity prices and a whole bunch of other factors has had an impact on the underlying security throughout all of history. If back testing is not done we will have no idea, at all, on how the security may react to these scenarios going into the future. We would be investing on a guess, or gut feeling which would leave us relatively clueless to the market.

The goal is to invest with a plan, and back testing gives us a lot of history on price reactions through a lot of different scenarios. If we can gain knowledge on how the price of a security may react, we will then be able to formulate an outline of a plan when something may arise or if we think something may arise that will affect the price. Having an entry and exit plan on a security will help our performances a lot in the long run.

Pros and Cons of back testing?

There are many pros to back testing and I will highlight the main areas of interest.

It will provide a general sense of price reaction history in the underlying security when economical factors or political factors present themselves. That will serve investors well because they will be able to place a general price range or price reaction when something occurs in the future.

Page 3: Back Testing Final Paper  (2)

It allows investors the chance to come up with a theory or trading strategy that they believe will be successful and actually map it out to see if it worked in the past, which may give some encouragement to go ahead with the strategy.

Going along with trying a trading strategy, an investor may try numerous strategies and then pit numerous strategies against each other to see which in the end would work best in different economical environments and different types of markets (bull or bear).

Being able to test trading strategies in: recessions, expansions, great corrections, normal corrections, bull markets, and bear markets is a great way to sample a wide variety or market conditions and gives investors an idea on what type of asset to invest in during these varying periods. Having knowledge of which asset classes performed best during each of these periods is very advantageous and will only allow a portfolio to perform much higher than the index averages.

There are some cons that investors have to be careful about when relying on back testing and I will discuss some of those below.

Even though a strategy may work well in a back testing model does not mean, in any circumstances, that it will for sure work in the future. There are no repeat days or exact same circumstances in the market, so an entry and exit strategy should be well thought out before going forward with any trading strategy.

Investors should try their parameters before back testing or may risk fitting parameters to the historical data. Laying out the strategy that you are thinking about implementing may be wise so that you don’t fit the back test data to the parameters.

Discuss the Steps in back testing

The steps in back testing could be numerous and very lengthy. I will try and break it down to be as simple as possible.

First, I would choose a security that is of interest to back test. I would also pick a security that has a decent amount of volume so that one could get in and out of trades at a decent bid-ask spread. If we have a good amount of volume we can be assured that the back test results are accurate and have a shot of working going forward.

Next, I would choose the parameters that are to be tested. Could choose a Simple Moving Average, Exponential Moving Average, Relative Strength Indicator, Moving Average Convergence Indicator, Money Flow Index, Bollinger Bands, and a multitude of many others.

Page 4: Back Testing Final Paper  (2)

After you choose the couple of indicators that you intend to use, then decide upon the ranges inside that indicator. For example I used a Simple Moving Average, and an Exponential Moving Average, I then used a 20-day, 50-day, and 200-day levels to test my data against.

Download the historical data from a site that you can trust and know is accurate. Make sure to get at least 10 years of data, or as far back as can go. Yahoo Finance is great for this as it allows the user to download the data right to excel.

Once you have the data, you need to decide how you want your trading program to work. You have a lot of options: go long and hold, go short and hold, buy on specific days, buy and stay long until an indicator is hit and then go short, etc.

Once you have your data and trading strategy in place, it is time to drill in deep and examine all of the data and crunch your numbers. Test your data at numerous points to make sure your results are accurate. I would test, numerous days per year to make sure the final data seems accurate.

Finally make sure to graph results as it makes it easier to see and read the actual results. Numbers are great but seeing a chart really shows what went right, and where it went right and also where things didn’t work out so well. Also calculate: profits, drawdowns, biggest gainers, and losers. We want to make sure that this is an investable trading program going into the future.

NETFLIX Back Testing

I performed back testing on the equity Netflix. Netflix is a world leader in online television streaming, with over 62 million members. They offer a variety of movie titles, television series, documentaries, and also began creating their own original content for this service as well. (Netflix About US)

They were founded in 1997 and had their IPO in May of 2002 for a price of around $15. Today their stock sells at a price of around $570. Netflix trades on the Nasdaq exchange. (Netflix History, Wikipedia )

The stock has a 52 week high of $575 and a 52 week low of $314 per share. The stock is very volatile and it is common to see 10-15% moves on quarterly announcements, and other big moves on analyst upgrades or downgrades. (Yahoo Finance, Netflix historical prices)

The strategy of back testing that I performed was to buy the open and sell the close every day, and see which day was best for trading. With this strategy I am not holding after hours or pre-market, so I will miss some big moves in both directions. Companies usually report after hours or pre market so there are a lot of big moves that take place in these markets.

Page 5: Back Testing Final Paper  (2)

I was pleasantly surprised as with this back test I found a big difference in the day of the week in which gains or losses would be made. At the outset I knew there would be differences but did not expect the wide-ranging differences that have been found.

Here are the results per day based on buying Netflix at open and selling Netflix at close. Note that these are stock point gains, not percentage gains.

As noted above there are vast differences between the days of the week that may have to deal with when the company announces quarterly results, or when analysts announce upgrades and downgrades.

From the above graphic we see that on a stock point basis Monday is the worst for longs and Tuesday is the best for longs. However I took this back test a step further and added percentage gains for each day of the strategy and tried an investment strategy of investing $1,000 buying open and selling close for just each workday on its own.

Here are my results on that back test:

1 45 89 1331772212653093533974414855295730

500

1,000

1,500

2,000

2,500

NFLX Investing on Monday

Series1

$$$

Monday had the least number of trades, and with $1,000 invested we would end up with $1,303.91.

Page 6: Back Testing Final Paper  (2)

1 49 97 1451932412893373854334815295776250

200

400

600

800

1,000

1,200

1,400

1,600

NFLX Investing on Tuesday

Series1

$$$$

$

I found this day very interesting, as if you would just add up the total amount of stock points that were gained on Tuesday it is the most at around 142 points. However if you actually breakdown the data and invested $1,000 at the beginning and trade off of the daily percentage ups and downs of this day it would be an underperformer at around $719. So you would actually lose money, and this is why back testing is so important. While the headline number looks great, the reality is that investing on this day would be a big loser.

1 49 97 1451932412893373854334815295776250

500

1,000

1,500

2,000

2,500

NFLX Investing on Wednesday

Series1

SSSS

Wednesday would give you an ending amount of around $1,803, from an initial investment of $1,000.

Page 7: Back Testing Final Paper  (2)

1 49 97 1451932412893373854334815295776250

2,000

4,000

6,000

8,000

10,000

12,000

14,000

NFLX investing on Thursday

Series1

$$$$

Thursday is the best day of the week to invest in, using our strategy. Thursday outperformed Netflix on its own merit. Thursday was 2nd for most point gains in our initial test at around 129 pts. However on this test it way outperformed, and was not a false signal. If we invested $1,000 and just traded the open and close on Thursday alone we would have ended up with around $12,220 total to date. That is an incredible rate of return, then consider that just trading on Thursday is 1/5 of a trading week, so in 13 years of history so adds up to be only around 2.2 years of actual trading. The results are very remarkable.

1 49 97 1451932412893373854334815295776250

200

400

600

800

1,000

1,200

NFLX Investing on Friday

Series1

$$$$

Friday was by far the worst day to put our trading strategy to work. Our ending investment would have been a total of $244, which is just shy of around 80% decline of our initial investment.

Page 8: Back Testing Final Paper  (2)

3 500 997 1494 1991 2488 29850

2,000

4,000

6,000

NFLX Investing $1,000

Series1

$$$

Finally, this is a chart of everyday of Netflix trading in the public markets. This is following the trading strategy of buy open and sell close every day for 13 years. Would have ended up with a total of around $5,160, for around an 89% annual return, which is a fantastic return.

Only one day of the week (Thursday) outperformed Netflix as a whole. The other days vastly underperformed the Netflix investment. However, investing only on Thursdays way outperformed Netflix overall.

All of these results were interesting, and surprising. I would have not thought there would be quite the large difference in investments on specific days of the week. My take is that unless you can decipher a day that performs way above, or below, find a great company and trade it on all days of the week.

Back Testing with the NASDAQ

For the main part of the back testing strategy assignment, I was given the NASDAQ. The NASDAQ began trading back in 1971. It was meant to usher in the era of all electronic trading. They credit that technology with being able to attract new growth companies: Microsoft, Apple, Cisco, Oracle and Dell. They began primarily as a US based equities market, but today it is known around the world with all types of technology companies. There are investors from over 26 countries. The NASDAQ is the second biggest index in the world, in terms of liquidity and market cap. (Nasdaq business history)

The strategy that I back tested was taking the daily prices of the NASDAQ going all of the way back to inception (1971) and going long when the price was above the 20 day simple moving average, and going short when the price fell below the 20 day simple moving average. I used Yahoo Finance, Nasdaq historical prices for all of the historical prices used in the following back testing strategies.

Page 9: Back Testing Final Paper  (2)

For this back testing strategy I began by downloading the daily data, and then computing the 20-day simple moving average. I then manipulated the data to see when we needed to go long the NASDAQ index and short the NASDAQ index. I then chose a starting amount of $1,000 and calculated through what our results would be.

I first want to show what the results would be if an investor took $1,000 and invested it in the NASDAQ index and just held it up until April 15, 2015.

11 1253 2495 3737 4979 6221 7463 8705 9947$0.00

$10,000.00

$20,000.00

$30,000.00

$40,000.00

$50,000.00

$60,000.00

Buy Index

Buy Index

By buying the NASDAQ index and holding we would see a decent overall gain. It would provide a profit of $49,077, and would yield an annual return of 9.3%. The max drawdown during this period would have been around 78%. This is a bit troubling as a 78% drawdown is somewhat large, and can really hurt an investment and therefore hurt future returns in a big fashion.

Here are the results of buying the NASDAQ index above the 20-day SMA and shorting the NASDAQ index below the 20-day SMA. We started with an initial Investment of $1,000.

Page 10: Back Testing Final Paper  (2)

11 1046 2081 3116 4151 5186 6221 7256 8291 932610361$0.00

$500,000.00$1,000,000.00$1,500,000.00$2,000,000.00$2,500,000.00$3,000,000.00$3,500,000.00$4,000,000.00$4,500,000.00$5,000,000.00

20 Day SMA

20 Day SMA

The results of this strategy are simply staggering. Just by the basic eye test from the chart we can see that our return was much greater, and our drawdowns were a lot less compared to buying and holding the index. Our total profit from this strategy was $2,472,178. The annual return from this strategy turned out to be 19.3%, which is fantastic for a period of over 43 years. This strategy produced a maximum drawdown of 47.1%, which is around 30% then a strategy of buy and hold. That is a key reason as to why the strategy was able to outperform but not the only reason. The strategy produced 6,145 Winning Trades, with 4,980 Losing Trades. The biggest gain that occurred was $346,933, and the biggest loss to our portfolio was -$479,052. These big gains and losses are a little nerve racking as it shows the volatility with this type of strategy.

Overall I am very happy with how this strategy worked, and the results that came from this style of investing. My biggest worries would be about the drawdown, which still seems fairly high, and the amount of trades that would have to take place to achieve this strategy. However, when we get into dealing with the larger dollar values the trades will not hurt.

Back Testing the NASDAQ to a 20 day Exponential Moving Average.

The next back test was to take the NASDAQ index and test it against a 20-day EMA. I used the same NASDAQ daily values dating back to 1971, but this time calculated the 20-day EMA of the index. Our strategy that was tested was to go long the NASDAQ index when it is above the 20 day EMA, and then short the index when it fell below the 20 day EMA. We started with an initial investment of $1,000.

Here is the graph of the results of the back test.

Page 11: Back Testing Final Paper  (2)

11 1046 2081 3116 4151 5186 6221 7256 8291 932610361$0.00

$1,000,000.00

$2,000,000.00

$3,000,000.00

$4,000,000.00

$5,000,000.00

$6,000,000.00

20 Day EMA

20 Day EMA

The results of this test were also superb as we can see, and again the numbers tell a great tale for our strategy. The total profit from this strategy was $2,391,264.84. This strategy would have provided an annual return of 19.2%, which is very good for a little over 43-year time frame. Our maximum drawdown that would have occurred is 51%. Would have had 6,143 Winning trades, with 4,982 Losing trades. Our biggest gaining trade was $349,032.72 and our biggest losing trade was -$476,264.31

Overall this strategy was very successful as well, and showed a great annual return along with a fantastic profit. It would have yielded around $80,000 less profit than our first strategy of long/short the 20-day SMA strategy. We also would have experienced a bigger drawdown than our 20-day SMA strategy by around 4%, which obviously had a factor on making a little less profit.

Back Testing the NASDAQ with the 20-day EMA and the 20-day SMA

This back test involved taking the NASDAQ index and then computing the 20-day EMA and the 20-day SMA. The strategy then was to go long the NASDAQ index when the 20-day EMA was above the 20 day SMA, and the shifting to shorting the NASDAQ index when the 20-day EMA fell below the 20 day SMA. We started this back test with an initial investment of $1,000.

Page 12: Back Testing Final Paper  (2)

11 1253 2495 3737 4979 6221 7463 8705 9947$0.00

$10,000.00

$20,000.00

$30,000.00

$40,000.00

$50,000.00

$60,000.00

$70,000.00

20-Day EMA/20-Day SMA

20-Day EMA/20-Day SMA

The result of this back test was unlike all of the other back test results we came up with for this assignment, and are worth researching further. As we can plainly see, the results are sub-par and we have a lot of variation, along with a big drawdown. The results produced even less profit than that of a buy the NASDAQ index and just hold throughout. This strategy produced a total profit of just $31,245.65, which is around $18,000 less than the buy and hold strategy. This strategy gave an investor an annual return of 8.2%. There were a total of 5,913 Winning trades, along with 5,212 Losing trades. Which is of interest because that ended up being the biggest amount of losing trades of all models that were tested for these strategies. The biggest losing trade was -$6,317.65, and the largest winning trade was $4,772.34. The sole bright spot would be a max drawdown of 56% that would have protected you over the buy and hold of the NASDAQ index.

I was surprised by these results more than of the two previous back tests. This strategy underperformed by such a large margin it is alarming. My theory is that the 20-day EMA is so much more susceptible to daily moves that it may contain too much variance and give a lot of false trend movements. This results in the strategy making a lot more false trades, and taking many of the marginal gains, and turning them into a lot of marginal losses. These marginal losses add up fast and take a huge toll on our investment returns.

Back Testing the NASDAQ Index, using the 50-day SMA and the 200-day SMA

This back test involved taking the NASDAQ Index and then computing the 50-Day SMA, and the 200-Day SMA. Then we bought the NASDAQ Index when the 50-Day

Page 13: Back Testing Final Paper  (2)

SMA was above the 200 Day SMA and sold the index, not shorting, when the 50-Day crossed below the 200 Day SMA. We began with an investment of $1,000.

11 1243 2475 3707 4939 6171 7403 8635 9867$0.00

$100,000.00

$200,000.00

$300,000.00

$400,000.00

$500,000.00

$600,000.00

50 DaySMA/ 200 Day SMA

50 DaySMA/ 200 Day SMA

The results for this back test showed a great graph, and a strategy that may deem to be the most investible going forward. As we can see from looking at the graph, it really takes off around halfway through the time period, and there is a very little amount of drawdown. The total profit for this strategy was $501,471.79, which is smaller than our 20 day SMA and 20-day EMA strategies, but give us a great advantage over the buy and hold the NASDAQ index. With this strategy we get an average annual return of 15.3%. We had 5,400 Winning trades, and only 3,504 Losing trades, which is the lowest amount of losing trades of all strategies that were back tested. With that result we also have the lowest maximum drawdown, by a large amount, at 20%. The biggest losing trade was - $915.82, with the largest winning trade at $1,208.44.

This result may be a winner as we have the lowest drawdown, which is great for an investment going forward. The losing trades and winning trades were also much closer together, so the volatility from this strategy seems to be much lower. An investor may be more confident in this strategy as it will not yield wild swings in either direction.

Back testing a strategy that is worthy of paying off

Page 14: Back Testing Final Paper  (2)

When I was first presented the task of completing this project I was skeptical of back testing and finding as an important tool. After going through the exercise and the numbers thoroughly, I now believe that back testing is not only a worthy strategy, I deem it as a necessity for investors. Back testing provides the investor with ammunition of historical prices, and outcomes that would never have been known if not running through the exercises. It also provides data through numerous economic markets, and outcomes. Having a general idea of different outcomes that may present themselves and how markets may react, can only help investors and allow them to further investment gains.

Going through the results of the back tests on the NASDAQ index that I have produced really was extraordinary. Following 3 of the 4 strategies would have improved annual returns by 70-100% from a buy and hold strategy. Going through this exercise has opened my eyes, and I know that going forward I will be looking at ETFS and back testing these through different strategies to try and get the best return possible.

This exercise has also gave me confidence that buy and hold for the long term is not the only game in town, and that it is good to trade in and out of the market if there is a strategy in place. If an entry and exit plan, and proper stops put into practice it is possible to trade in and out of markets and do far superior to what a buy and hold strategy will produce.

Hedge Fund trading practices

Long-Short Equity

A strategy that takes pairs trading into account. Pairs trading is where you may take two companies in the exact same industry and trade them differently. (O’Hara, Mulitple Strategies of Hedge Funds)

For example if you take a look into the fast food industry and picked out McDonalds and Burger King, you would make a decision that one has an upper hand on the other. If you thought McDonalds was a better run company than Burger King you would go long McDonalds and at the same time short Burger King. In that respect for the trade, the investor is trying to be market neutral. If both gain, the hope is that McDonalds would gain further and thus would still make money. If both lose value, the hope is that that McDonalds would lose less, and the trade would still be positive, as the hope is that it will have a leg up on the competition. Doug Kass runs a fund called Seabreeze Partners, and writes about these types of trades on Realmoney.com, and on his personal twitter account.

Short Equity Fund Only

This is a strategy where the fund and its manager are looking for opportunities in the markets in which they believe that companies have become overvalued and are

Page 15: Back Testing Final Paper  (2)

ripe for a decrease in value. In that instance, this type of fund would be looking for companies to go short on. Jim Chanos of Kynikos Associates runs a short equity fund with about $1 Billion in assets, which is one of the largest funds of this type of primarily short equity fund. In testimony to the SEC Mr. Chanos gave insight to how his fund spots these short opportunities: “ (1) materially overstated earnings; (2) an unsustainable or operationally flawed business plan; and/or (3) engaged in outright fraud.” (Jim Chanos, SEC Testimony) Hedge funds are able to afford to pay for the research to find companies that have these problems. Without enough money it would be hard to do all the accurate research that would be needed to find out these problems.

Activist Hedge Fund model

This is a category that I have been following, and while it may not be an exact model, it is something that is becoming the new normal. After watching, studying, and following the markets for 4 years it is obvious that there are a couple of big fund managers that use there sheer size to steer their investments. This strategy usually involves the fund buying a big stake in a company, up to 10-12%. Then they try to get a couple of members on the board, and either force management to do what they think is best for the company, and the stock or force a proxy fight. A lot of the demands circle around: increasing dividends, stock buybacks, acquisitions, or out right sales. A couple famous activists managers are: Carl Ichan, David Einhorn, and Bill Ackman. Carl Icahn and David Einhorn bought big stakes in Apple and both were very vocal about them increasing dividends, and stock buy backs, and they have done both since these managers have been shareholders. Forbes detailed in an article that Bill Ackman has had a very public big short on Herbalife, which he took on after David Einhorn had brought up some skeptical facts about the company. (Vardi, “Bill Ackman’s Herbalife Short Bet Gets 30% Better”)

The short has not gone perfectly and we will have to wait and see how it ends up. However it is clear that with social media, and more public outlets, activists investors are on the rise.

Page 16: Back Testing Final Paper  (2)

Sources

Netflix About US(https://pr.netflix.com/WebClient/loginPageSalesNetWorksAction.do?contentGroupId=10476 )

Netflix History (http://en.wikipedia.org/wiki/Netflix)

Yahoo Finance- Netflix(http://finance.yahoo.com/q?s=NFLX&ql=0)

Nasdaq business history(http://business.nasdaq.com/discover/nasdaq-story/index.html)

Yahoo Finance, Nasdaq Historical Prices

Neil O’Hara, “The Multiple Strategies of Hedge Funds”Investopedia(http://www.investopedia.com/articles/investing/111313/multiple-strategies-hedge-funds.asp)

SEC, Hedge Funds Spotlight Jim Chanos on Hedge Funds SEC Testimony(https://www.sec.gov/spotlight/hedgefunds/hedge-chanos.htm)

Nathan Vardi, “Bill Ackman’s Herbalife short bet gets 30% better”Forbes (http://www.forbes.com/sites/nathanvardi/2014/03/18/bill-ackmans-herbalife-short-bet-gets-30-percent-better/)