CustomMenu

Monday, March 16, 2015

Momentum Rotation Strategies and Data - Part 2

In Part 1, I discussed an issue that can occur when using dividend adjusted price data in Momentum Rotation Strategies that select funds based on a relative ranking algorithm.  I outlined three different data approaches that can be used, and presented a simple rotation strategy and portfolio to illustrate this data issue.  For additional background please see Part 1, and my older post: Historical Data and Momentum Rotation Strategies

In this post we will dive right into the backtest results.  In the diagram below, three equity curves are displayed for the simple 60 day dual momentum Rotation System outlined in Part 1.

60 Day Momentum Rotation Strategy Equity Curves
(click to enlarge)
 The blue curve labeled "Adjusted" is the equity curve generated from our momentum system using dividend and split adjusted data.  The signals and P&L are derived only from the adjusted data time series.  The red curve labeled "Actual" is the equity curve generated from our momentum system using only split adjusted data, that has not been adjusted for dividends.  It is lower, as expected, since dividend are not included.  The green curve labeled "Hybrid" is the equity curve generated from our momentum system using the "Actual" time series for signal generation and the "Adjusted" time series for the P&L calculation.  This is a two step process...first the system is run across the "Actual" time series data to derive the trade dates and ETFs selected.  The second step use the dates and ETFs selected in step 1 to to calculate P&L from the "Adjusted" time series data.

For this example, I selected a portfolio of ETFs and a Rotation System that had a small difference between the Hybrid and Adjusted data equity curves.  If Adjusted data did not have an impact on ranking, then the two curves would exactly overlap.

What we can see in the next two images are the signals, or ETFs selected, by the strategy from the "Actual" data set and the "Adjusted" data set.  The chart below shows the ETFs selected (and held) by the strategy by date using the "Actual" time series data.

ETF Holdings By Date From Actual Data Signals
(click to enlarge)
The chart below shows the ETFs selected (and held) by the strategy by date using the "Adjusted" time series data.  It is obvious when comparing the chart above with the cart below that the signals, or ETFs selected do not match...although they are close!

ETF Holdings By Date From Adjusted Data Signals
(click to enlarge)
In my view, this is a pretty clear sign that using dividend adjusted price data will cause your relative ranking systems to generate results, and signals, that will change with time.  I have experienced this first hand with my live rotation systems.  Occasionally I will receive a signal to sell one ETF and buy another ETF...where the ETF I am supposed to sell is not the ETF that I am actually holding from the prior month's signal...when real money is on the line, understanding the cause of this situation is vitally important!

In the next post, we will look at another example...

If you don't want to miss my new blog posts, follow my blog either by email or by RSS feed.  Both options are free, and are available on the top of the right hand navigation column under the headings "Follow By Email" and "Subscribe To RSS Feed".  I follow blogs by RSS using Feedly, but any RSS reader will work.

8 comments:

pcavatore said...

Dave IMHO you should focus more on how you calculate your rotation signals...if your signal is calulated using price ratios (ie. returns over prev X months) than using ratio back-adjusted data makes perfect sense since you get real results including the dividend yield. If your signal is calculated as a price difference you should use difference-adjusted prices.

Having said that you should always back-adjust for both dividends and splits if you want to get real results including dividends which you do receive.

This is covered in basic books like "Technical Analysis of the Financial Markets" by Murphy.

Paolo

Dave R. said...

Paolo, the momentum rotation results posted were calculated using AmiBroker, using the ROC formula. This formula is described here: http://www.amibroker.com/guide/afl/roc.html

Let me know if you think there is an issue with the AmiBroker ROC formula, but it appears to use the approach you described.

One question for you Paolo...are you trading a rotation system live?

Thanks,
Dave

Cesar said...

Dave,

Are you using Yahoo's dividend adjusted prices? I don't how they adjust the prices. If the prices are adjusted by subtracting the dividend amount from previous prices. This method does not keep the percentage returns constant. Data providers like CSI Data and Premium Data, allow one to adjust the prices proportionally, thus the percentage returns stay constant even after the adjustment.

There is a good description here http://www.xignite.com/Support/FAQ.aspx?faqtype=Products&faqcat=XigniteHistorical#ka0400000008S5eAAE

Cesar
www.AlvarezQuantTrading.com

pcavatore said...

Dave, there is no issue with Amibroker's ROC formula...what I'm saying is that you must be aware of how your signal is calculated. ROC is a price ratio and therefore using ratio backadjusted prices makes perfect sense since ROC calculation referred to a specific period doesn't change no matter when you perform it...that's why you don't get different signals when rerunning your backtest.

Regarding your last question, yes I do have real experience with rotational systems, that's why I fully understand your concern regarding "disappearing signals" or paper signals not confirmed by real ones :-)

Dave R. said...

Hi Cesar,

I am using Yahoo's dividend adjusted prices. They have a description of their process at this link: https://help.yahoo.com/kb/finance/historical-prices-sln2311.html

Also, it appears that Yahoo's historical data is provided by CSI:
https://help.yahoo.com/kb/finance/SLN2310.html
"Historical chart data and daily updates provided by Commodity Systems, Inc. (CSI)."

BTW, I am a frequent visitor to your site and appreciate you commenting on this topic!

Thanks,
Dave

Dave R. said...

Hi Pcavatore,

Here's the AB code where the score is calculated for this blog post:

Score = ROC(Close, 60);
PositionScore = IIf(Score < 0, 0, Score ); // Long only

As I mentioned to Cesar, I am using Yahoo historical data (one database for adjusted price data, and another database for non-adjusted price data). Based on Yahoo's help pages, their historical data comes from CSI.

Any other ideas? The issue I am observing in live trading and illustrated in a couple of posts has fewer and fewer explanations other than the dividend adjusted data.

Thanks,
Dave

pcavatore said...

Dave let me try to recap:

1. you should match the algorithm used to back-adjust your price series with the signal formula you choose...if your signals are based on percentage differences (ROC) you should use ratio-adjusted prices for preserving percentage returns as Cesar was saying.

2. unfortunately Yahoo's methodology to back adjust prices in order to consider dividends does NOT preserve returns while the methodology used for split adjustment does as per the explanation page you mentioned.

3. in order to get realistic results from your backtest you would use one price series for signal generation (preserving the signals) and one for calculating performance (preserving the returns). Ideally you would like a single time series preserving both signals and returns but unfortunately Yahoo data does not.

4. having said that using prices adjusted for splits only seems to be the best solution but your final results would be underestimated by the total amount of dividends being paid.

Sorry for the long (and maybe confusing) reply but the general idea is to always match the backadjustment methodology with your signal calculation formula...if your data source is Yahoo and your signals are based on ROC,using split-adjusted prices sounds reasonable considering you're missing the dividends in your final result.

Dave R. said...

Paolo,

Thank you for your suggestions,,.I think you made some good points!

I just posted part 4 of this series with some further thoughts.

I will post on Momentum Rotation again after I find the cause of the ranking instability.

Thanks again!

Dave

Post a Comment