November 23, 2015

Five ETF Monthly Rotation Strategy

I was working on another blog post when I saw this post Inferences From Backtest Results Are False Before Proven True on Price Action Lab. Mike has a challenge to replicate a very simple test. I often get email from people trying to replicate results from one of my blog posts and thought this would be fun to do. I cover some of this topic on my post Backtesting is Hard.

The Rules

  • Monthly Data: 01/2007 – 10/31/2015
  • ETFs: SPY, EEM, TLT, GLD, DBC
  • Score: 3-month ROC
  • Two open positions only
  • 50% allocation
  • Long-only
  • No rebalancing
  • Adjusted data from Yahoo Finance

Although this seems like a simple strategy, his results are not close to the test he was trying to match. When I get rules from consulting clients, we spend a lot of time clarifying them. Here are my questions:

  • What of entry or exiting timing? Is it at the close or the next open or some other price? I will test both.
  • What are commissions? I will use zero.
  • What is the starting portfolio value? I will use $100,000.
  • What about lot size? Do you round to the nearest share, nearest 10 or 100? I will use 10.
  • Is the data adjusted for dividends? My data is adjusted and provided by Norgate Data.

 

The Results

  AQT AQT PAL PAL  
Parameter Trade on Close Trade on Open Trade on Close Trade on Open Portfolio Visualizer
CAR 14.48% 12.47% 11.82% 9.65% 14.52%
Max. DD -19.45% -21.02% -19.08% -19.70% -20.45%

 

My trade-on-close results match closely to what Portfolio Visualizer gives. Why Price Action Lab has a different value for CAR, I do not know. He is probably making a different assumption somewhere which does not mean his code is wrong. This is something people have a hard time understanding that the same rules can produce different results. Unless you get all of your assumptions the same, you sometimes won’t match. There may be a question I forgot to ask that we answered differently.

Or it could be because we are using different data sets. This is the most common reason.

<Added on 11/24/2015>

After several emails with Price Action Lab, we discovered why we were getting different results. It came down to a different interpretation of the rule ‘Score: 3-month ROC.’ I ranked and entered the top 2 ETFs even if the score was negative. While Price Action Lab, ranked and only entered the top 2 if they had a positive return. Both results are correct. It is matter how you want to interpret that rule. How would you read that rule?

< End addition>

 

Want to Play

Do you want to join the fun? Run the test and post your results in the comments. I am providing the trade list for both runs so you can compare your results.

Spreadsheet

Fill in the form below to get the trade lists and monthly returns.

Final Thoughts

Are my results correct? Maybe. I did this quickly to get the post done today before the holidays. There is a higher likely that I made a mistake or a bad assumption in the rules. It is easy to say someone’s results are wrong. What is hard is trying to replicate them yourself which is what you should always do.

Trust but verify all test results.

Backtesting platform used: AmiBroker. Data provider:Norgate Data (referral link)

Good Quant Trading,

Fill in for free spreadsheet:

spreadsheeticon

 

 

Click Here to Leave a Comment Below

Michael Harris - November 25, 2015 Reply

Cesar,

I thank you for your input. I could not have figured this out without you because it did not occur to me to look at actual ROC values as you suggested in your emails.

Backtesting Conundrum | Price Action Lab Blog - November 27, 2015 Reply

[…] only quant trader was Cesar Alvarez who is well-known for his accomplishments in this area. He also posted his analysis in an article. […]

adrian - December 3, 2015 Reply

Hi Cesar,

How on earth do you adjust premiumdata’s data for dividends? I use premiumdata, and their data is not dividend adjusted. I’m not much of a coder, and can only imagine the difficulty in such a task for say the SP100.

Adrian

    Cesar Alvarez - December 3, 2015 Reply

    I use Premium Data and I am part of the Alpha program. I don’t know if you need that to be able to adjust for dividends. You can check in AmiBroker by going to File/Database Settings/Configure. The look under Adjustment method for “Ordinary Cash dividends” and check that. If you do not see this option, email support at Premium Data and ask to be added to the Alpha program

adrian - December 5, 2015 Reply

Thanks Cesar.

I am not in the Alpha program and do not have that option in Amibroker. I’ll contact PremiumData and see what I need to do to participate.

I ran your test, and (eventually) got the same results, with the exception of non-dividend data. Entry dates are the same, but EEM,SPY and TLT has different entry/exit prices because of the adjusted data. GLD and DBC are the same as mine. My results were AR 12.27% and DD -21.56% for Trade on Close data.

I originally could not get near the right results until I used the “worstrankheld” to change the exit criteria to match requirements.

Adrian

PS You have a typo in the rules – exit year 2007 instead of 2015

    Cesar Alvarez - December 5, 2015 Reply

    Good to see we come close.

JJ - December 9, 2015 Reply

Hi Cesar,

I’m interested in figuring out how you came up with the initial pool of securities: SPY, EEM, TLT, GLD, and DBC. One of the challenges, from my experience, of rotation strategies is finding a sufficient “clique” of assets are are NOT very correlated with each other.

– JJ

    Cesar Alvarez - December 10, 2015 Reply

    The list of ETFs came from the article that I was basing my article on. You are right one of the hardest parts of creating an ETF strategy is that list of ETFs. They can have a huge influence on the strategy.

Scott Hodson - June 5, 2019 Reply

How did you test this on Portfolio Visualizer? Something like this?

https://bit.ly/2XsVfkZ

I’m only getting at best 10% CAGR, I’m not sure if it’s including dividends or not, and not sure how to only allocate 50%

Does the “50% allocation” mean that the two holdings are 25% each, and 50% is in cash? Or 50% for each of the 2 holdings, so 100% in the market?

I also included a moving average filter, so the instrument can only be held if it’s above its 10-month moving average (similar to a 200-day MA)

    Cesar Alvarez - June 6, 2019 Reply

    I cannot remember how I did this on Portfolio Visualizer.
    50% means 50% in each ETF so will be 100% invested.
    A 10-month and a 200-day MA will give different results. I should do a post about how even these are about the same they can give very different results.

Leave a Reply: