## Learn To STOP Curve Fitting!

Download this free guide on how to stop curve fitting. Following these four simple steps can improve your trading dramatically!

In last week’s article called, “Backtesting A Basic ETF Rotation System in Excel – Free Download“, Dan presented a simple rotational trading model which anyone could implement given a little knowledge in Excel. What I love about trading models like this is the simplicity. So often simplicity trumps complication. Simple systems often have one important characteristic. They often get you out of the market during bear markets and get you back in to ride the next bull cycle. That is, if you are disciplined enough to actually follow the rules, which of course is another entire topic.

Was the presented trading model perfect? Of course not. Looking at the equity curve it’s not very smooth. It’s personally not something I would trade. However, I hope the article gave you some ideas on what is possible with just using Excel.

At this point I would like to see if we can make some improvements in the trading model. Instead of using Excel I’m going to use the on-line backtesting service called ETFReplay. This web service allows you to create trading models and backtest them on a portfolio of ETFs. The website charges a monthly fee to use their service, but it’s very reasonable. It will be much quicker for me to test my changes using this service than using Excel. This is the same service I’ve used when creating the Ivy-10 portfolio.

First, I will recreate Dan’s original portfolio using ETFReplay to see if we get similar results. As a reminder, below is the original equity curve from the article. The trading model is the blue equity line.

Below are the results of the same model created in ETFReplay. The green equity line is our trading model while the blue line is the SPY (baseline).

As you can see the equity lines appear very similar. The ETFReplay version does end higher due to the fact my backtest ran through the entire year of 2014. This gives me confidence that the Excel model and the ETF model are identical in trading logic.

I will use the ETFReplay results as our baseline to compare our future results. To do this, we will need an in-sample data segment to test upon. Those dates will be through the year 2012. This gives us just over 100 trades for our in-sample data segment. Our baseline results are below.

When I look at the drawdown (31.4%) and view the equity curve of the original model, we can see it’s not very smooth. There are huge swings. Take a look at the huge peek in 2011 which falls dramatically. I would like to smooth it out. To do this, I’m going to use some ideas from the Ivy-10 rotational model.

First, instead of simply trading only the top ranked ETF I’m going to pick the top two. This will provide some diversification as our returns won’t be based on a single ETF. Next, I’m going to add a 5-month simple moving average (SMA) filter. This is the same filter length used in the Ivy-10. Adding this SMA filter will force the trading model to only buy an ETF when it’s experiencing a bull market. For our backtest the ETF SHY will be purchased if a top ranked ETF can’t be purchased because it’s below the SMA filter. SHY is Barclays Low Duration Treasury ETF. This will be our cash equivalent.

In summary, we are changing these two settings:

- Buying the top two performing ETFs
- Buying only when an ETF is trading above its 5-month simple moving average

Below are the results when adding our two changes.

This is a huge improvement as we noticeably smooth the equity curve. We can see this in the drawdown which went from 31% to only 17%. Notice the annual return also increased from 13% to 16%.

There is one other modification I would like to make.

The ranking score is the method we use to rank the performance of each ETF in order to determine which is the best performing. The baseline system simply computes the 5-month return. In past studies I’ve found that using both short-term period and a longer-term period can help improve overall system performance. Thus, I want to expand the ranking method by looking at both a 3-month return (1 quarter) and a 20-day (1 trading month) return. I simply take the average of those two values to generate a ranking score.

Applying this simple change produces the following results on our in-sample data segment.

This produces an increase of about 1% in the annual return but does nothing to change the max drawdown.

Let’s now apply our new model to our out-of-sample results. The out-of-sample results will conclude on December 31, 2014.

It appears we are making new equity highs. For the years 2013 and 2014 the trading model returned annual returns of 12.9% and 4.4% respectively. We can see our final CAGR is 15.9% and our max drawdown remains at 17.6%.

With a few minor modifications it appears we can improve this trading model to the point where it actually might be tradable with real money. At this point I don’t feel there are enough trades in the out-of-sample segment. Note our in-sample results consisted of 170 and our out-of-sample run had a total of 202 trades. This means we only have about 32 trades in the out-of-sample data segment. It would be nice to have some more trades logged and that means we sit tight and watch this model for at least another year.

Jeff is the founder of System Trader Success – a website and mission to empowering the retail trader with the proper knowledge and tools to become a profitable trader the world of quantitative/automated trading.

**Session expired**

Please log in again. The login page will open in a new window. After logging in you can close it and return to this page.