iBankCoin
Joined Nov 11, 2007
1,458 Blog Posts

Building a Better Fidelity Sector Fund Rotational System: Part 3, Final Edition

Part 1

Part 2

After two years of in-sample results and some tweaks to the first version of the system, the Fidelity Sector Fund Rotational System is ready to go live.

Based on the analysis I presented in Part 2, I have changed the inputs on system’s variables. Some were changed more than others. The goal was to set the inputs to areas that had proved to be robust over a 20 year time period and over the past 2 years. If one carefully observes the charts I present in Part 2, an educated guess can be made as to what was chosen.

I have also added a new feature which allows the primary variable, the rate-of-change (ROC), to adapt to volatility.

After re-setting the inputs, I ran a final optimization of the primary ranking mechanism, the ROC. I wanted to be sure that I had not curve-fit the system. The results are below.

Click on the graphs to enlarge…

The graph above uses over 20 years worth of data.

There is a large sweet-spot from about 105 to 135 where CAR and Maximum System % Drawdown are both very stable.

The graph above represents about 12 years worth of data.

It too shows a large sweet-spot from about 110 to 145.

These graphs demonstrate that the primary ranking mechanism still offers a large area from which to choose a setting. Warning: because I have made the ROC adaptable to volatility, simply choosing a ROC length from these graphs and using it is likely to generate a different (but still decent) future performance from this system.

System Stats:

I’m going to use 1.1.2000 – 1.27.2012. Starting the system back further yields better results (and you can get an idea of what they would be from previous and current graphs). The last decade or so has really been a brutal time to be in the market. Keep in mind that I can slightly alter a few inputs and make more recent performance look better. That was not my goal. Window dressing a system for the public is tempting but is ultimately ridiculous and maybe even reckless.  My goal was to choose robust settings that will perform consistently well in the future, and I feel I have done so.

Equity Curve and Drawdowns:

Final Thoughts:

One must expect performance to be worse and drawdowns to be larger than what they are in backtested historical results. That being said, ROC as a ranking mechanism has been unbelievably stable, as has the sector rotation model. Since I will be trading this on funds meant for retirement, I will be happy with a 10% annual return, and I believe this system will achieve it. Furthermore, it will require very little time to manage, and should have smaller drawdowns than a buy-and-hold strategy.

There are likely further tweaks or even outright changes that I have not considered, or even fathomed. I would appreciate hearing your thoughts if you think I have missed something, or if you just have a neat idea.

I did add Fidelity Bond Funds into the rotation, as suggested by MyBestFunds, but they hurt performance. I believe this is because the system punishes volatility. Since bond funds are typically less volatile than sector funds, the bond funds out-ranked and replaced sector funds from time to time in the rotation. Removing the moving average filter and including the bond funds (in hope they would be picked during bear market phases) only made things worse.

 

 

Comments »

Global Warming and Stock Markets: Fun With Technical Analysis

As we enjoy another weekend here in the iBC domain, I thought I’d take some time to indulge in a slightly off-topic exercise. I say “slightly” because what I will present is tangentially related to stocks, graphs, backtesting, statistics, and data.

As some of you have likely realized, I stay engaged in the anthropogenic global warming debate, partly because of how politically charged it has become and mainly because I find the physics and the data and statistics to be fascinating.

But there is another reason why I enjoy following the climate change research, and that is because the climate change industry seems to me to be very similar to the finance/econometrics industry. Let’s look at the similarities:

  • Both industries create models to predict future prices or temperatures.
  • Both industries use long datasets consisting of time series to create the models.
  • Both industries use the models to alternatively fear-monger or allay fears.
  • These models are used to redistribute $$$ from one group to another via profits or losses and/or taxation.
  • Both industries are dependent on government support (in terms of both legislation and financial support) in order to continue their current practices.
  • Both industries have celebrity-type practitioners who have become the face for the predictions and analysis.
  • There are few ramifications for the celebrities when their predictions fail.

I could go on, and would enjoy hearing other similarities in the comments section, but I think the thrust is clear – the industries are very similar.

And so I’m always surprised, since we have yet to produce a reliable model to predict future stock market performance, that we would think we could accurately predict future temperatures. In fact, the processes used to generate the climate models seem very similar to how we backtest and create strategies for the stock market. Substitute CO2 for Earnings and Temperature for Price. Just as an increase in earnings may not mean an increase in price, an increase in CO2 may not mean an increase in temperature. But I digress… The point is that the factors that drive both the capital markets and climate change are numerous, and they interact with each other in a way that is extremely complex. Simple models are not complex enough and complex models are likely curve-fit as the researcher attempts to mimic the myriad interactions between the variables.

Anyway, all that is really neither here nor there. What I want to do is introduce a site that I really like as it allows the layperson to graph temperature time-series and perform basic analysis of the data. Much like finance 50 years ago, the public has surprisingly little ability to check the actual temperature data against the many predictions and narratives about climate being presented in the media.

The site is Wood For Trees.

The site uses temperature data sets from various sources and makes available free software to graph the results.

Let’s look at some examples of graphs I’ve generated. I’m going to do my best to cherry-pick the data to show climate alarmism, from the perspective of the coming Ice Age.

Above is the HADCRUT3 variance-adjusted global mean. Looks like the globe is cooling, no?

Here is the CRUTEM3 variance-adjusted land global mean. Still looks like cooling, no?

Alright, enough with the cherry picking. Let’s look at a longer time frame and add a linear trend line. The site makes it easy to do so.

Okay, so I did a little cherry-picking with the trend line to show that the last 14 years have seen a down-trend in the global annual mean.

To be fair to my climate alarmist friends, we’ll finish with a look at the big picture.

Above is the global annual mean temperature from 1850.

It must be mentioned that some of the data has been manipulated, fudged, back-adjusted, etc., and the sources for some of the data were/are famously lost. A favorite tool of some of the climate scientists is the back-adjustment of older temps to make them cooler, therefore making current temps appear to be warmer. Curiously, older temperatures are seldom back-adjusted to be warmer. Also, one can imagine the nightmare that must be the management of the thermometers themselves, on land and sea, and the careful adjustments that must be made to account for effects such as the urban heat island.

So there you have it. Graph and analyze temperature until your heart’s content. I’m sure some of you will be tempted to apply standard stock market technical analysis to the graphs. Don’t worry, I do it, too. My prediction is global climate is consolidating after a huge run-up. I’m looking for temperature to breakdown through 15 years of support, sometime over the next few years 😉

Comments »

Building a Better Fidelity Sector Fund Rotational System: Part 2

Link to Part 1

In this post, we’ll look at the components of the system, and then optimize the variables and plot the results. What we hope to find is that each variable has a wide range of settings from which to choose. What we don’t want to find is that making a slight change to a particular variable has a significant impact on performance. If a slight change has a significant negative impact on performance, it is likely that the results are not robust.

The system:

  • Uses momentum measured by Rate of Change (ROC) to rank the Fidelity Sector Funds (FSFs).
  • Punishes volatility by dividing into the ROC calculation a simple measure of volatility.
  • Uses moving averages to set 3 levels of position sizes: 100%, 50%, or Cash.
  • Uses a shorter ROC to ensure the top-ranked funds have not been recently downtrending.
  • Holds each FSF for a minimum of 30 calendar days before rotating out of it (This is a requirement from Fidelity. Executing a round trip trade within 30 calendar days will result in penalties).
  • The system can hold between 1 and 10 FSFs. (Because Fidelity wants a minimum of 2.5K in each fund, holding more than a few funds may not be practical for smaller accounts).

To run the optimizations, I’ve set the inputs to be exactly the same as version 1.3 of the system. The only difference is this: Instead of a completely binary moving average filter where if $SPX is below the 50 day moving average it does not rotate into a new fund, I’m using two moving averages. If $SPX is below the first moving average, any new FSFs will be invested at 50%. If $SPX falls below the first and second moving average, then the system will go to cash and will not rotate into a new fund. This is a technique that Michael Stokes wrote about here, except he uses six moving averages to set the position sizes.

Okay, with that out of the way, here are the variables and inputs used to run the optimizations:

  • ROC setting is 90.
  • Volatility lookback period is 252 days
  • The two moving average periods used to set the position sizes are 50 and 100.
  • The shorter ROC setting is 21.
  • The system will hold a maximum of 3 FSFs.

I’m testing using the funds listed here on Fidelity’s site. Most of the FSFs were available to be traded before the start date of the test.

Using these inputs, let’s examine the graphs created by optimizing each variable, one at a time. First up is the ROC length.

This is perhaps my favorite graph. We can see that momentum is present across all ROC lengths. It appears the sweet spot has been somewhere between 25 and 85.

The graph above has reduced the time period of testing to just over 2 years. It is evident that the shorter ROC lengths have performed better. My theory on this is that it is due to the volatility of the last 2 years. This time period has been characterized by spikes in volatility and volatile range-trading. A longer ROC length is not able to capture an accurate measure of momentum due to the up and down trading while a shorter ROC length can catch new momentum just after it begins.

Next we will optimize the volatility look-back period. This calculation is used to lower in rank the more volatile FSFs.

Shorter is better for smaller drawdowns, while longer lengths improve CAR. Overall, the volatility look-back length can be set to just about whatever one pleases with little chance of curve-fitting.

Over the last two years, a shorter look-back has provided higher returns while not having a negative effect on drawdowns. I believe the length can be shortened (currently at 252) to improve performance.

Next, we’ll optimize the second moving average length. I am going to leave the first moving average set at 50 days. That decision reflects personal preference coupled with the knowledge that the system performed well in previous tests using the 50 day average.

There are several things to discuss about the above graph. First, if the second moving average length is set to 50, then the system goes completely to cash whenever $SPX is beneath this average. We can see that this gave the highest CAR, but also led to the highest drawdown. If the second moving average length is less than 50, then the system would go to 50% position-sizing whenever $SPX is less than the average and would go completely to cash once it dropped beneath the 50 day average. Using a 30/50 combination yields good results, but there is not a lot of room on either side of the 30 before either drawdowns increase or CAR decreases. The optimum setting looks to be somewhere between 110 and 155.

Over the past 2 years, a simple 50 day average filter has performed very well. However, we see there is still a generous sweet spot between 125 and 160. The 50/100 moving average filter could be adjusted to use a longer length.

Now let’s look at the second ROC length. This input is used to ensure that the top ranked FSFs have not been falling over the near term.

We are only concerned with the results from 5 to 41. Anything longer than that begins to weigh heavily on the ranking procedure, since the FSFs are ranked based on a 90 day ROC.

It looks like my choice of a 21 day ROC was lucky. I took a look at the greater than 30% drawdowns, and almost without exception they are all the result of one period in time when the system’s equity curve went from a nice steady uptrend to an almost straight-up surge. When the surge ended, it resulted in a large drawdown from peak equity, although the equity never actually drew down much past the pre-surge amount.

The graphs above show a similar pattern favoring short lengths over the past 2 years. A setting between 10 and 25 would probably work well.

Finally, let’s optimize the maximum number of FSFs held at one time.

The graph above shows that adding positions decreases both CAR and Max Drawdown. The best setting is likely between 2 to 5 funds. Holding 5 funds means that the portfolio would consist of approximately the top 10% of the 40 available FSFs.

Over the last two years, we would have been better off holding only 1 or 2 funds.

Well there you have it, a veritable menu of settings available. Keep in mind that every adjustment made will introduce unknowns and unintended consequences into past and future performance. The best we can do is choose robust settings and trade the system diligently and faithfully. At times it will outperform and other times it will under-perform, but over the long haul, it should beat buy and hold with reduced drawdowns.

Some of you may wonder why I put together all of this for the blog. It does take a significant amount of time. I create the graphs for my own use, and writing about them solidifies my thinking as well as sparking the creative juices. In fact, I have likely discovered a simple way to make the ROC length adaptable to market conditions, and I think it will improve results. I do not believe I would discovered this had I not written this post.

Finally when designing a system to trade for years into the future, it is important to know the system inside and out, how each variable affects the other variables, and so on. A complete understanding of the system’s intricacies builds trust and faith which will be necessary to draw upon when the system hits the inevitable rough patch.

Part 3 will present the “finished” system.

Comments »

Quick Note: ROC Indicator is Short, Again

This thing is flipping more than hamburgers in a McDonald’s restaurant with rat-filled bags-o-buns.

As of Friday, it flipped again, to short.

A quick glance at the history of this indicator with SPY shows that this is fairly unprecedented. I keep thinking it must decide on a direction, soon. Perhaps I’m wrong?

Actually, there was one other instance of this (see the two yellow circles) but it was early in the SPY history, so I’m not sure that it deserves a great deal of significance.

Comments »