Any Interest In Joint Development of Sector Rotation Model?

Marc Gerstein recently wrote about the importance sector rotation. “If you want to stick with quanting and testing on p123, I suggest devoting your energies to working with a small InList consisting of the SPDR sector specialty ETFs and looking for a technical model that can help you spot rotations.”,12564_lastpage,yes#!#76241

I follow two momentum models that are coded in google sheets but would like to code them in P123, but it’s a matter of time.

Perhaps someone who has some P123 code they would like to share for sector rotation, perhaps there is interest in a joint model development project, perhaps someone at P123 could even build an ETF sector rotation model to be made public, or perhaps some combination. I’m looking not just for a ranking system, but also the universe, functions, screens, buy and sell rules, etc. If there is interest, we might set up a GitHub project for a virtual team.

Mostly what I’ve seen for sector rotation, is to use some function of momentum indicators, such as the average of 12-month performance + 6-month performance + 3-month performance + 1-month performance, or to use a weighted version such as 12/191-month performance + 4/193 month, + 2/19 * 6 month + 1*12 month. And to then choose a subset of ETFs, say 3 from a universe of 12. I’ve also seen the use of Exponential Moving Average, Double Exponential Moving Average, price related to trend, and so on. I’m sure others must have additional ideas.

One interesting enhancement is to calculate the overall basket performance, to calculate the correlation of each individual ETF with the basket, and then to use some function to promote those with lesser correlation to the basket with the assumption that buying 3 ETFs with high momentum, but lower correlation may outperform.

Another potential enhancement is to divide ETFs into sets by sector, and to then select the best ETF for the best sector. This can work in various ways, such as to find the sector(s) with the best momentum, and then the ETFs within the sector with the best momentum. This can also be done by factor or style. The same concept can apply to country. I would love to develop a sector rotation model for China.

Another possible enhancement to sector rotation is to overlay the economic quad. Economic quad can be defined using the change in growth and inflation. Historically, the quads can be calculated from public data sources and it’s then possible to calculate which ETFs (sectors, styles, factors) work best in each Quad. The quads can themselves be further divided into 4, as extremes within each quad can also influence performance. The requirement then is to predict the quad going forward, which HedgeEye does, but it appears there are other public sources for these predictions as well. This approach can also be done for country rotation.

Market timing is another overlay. There is an excellent paper called Growth Trend Timing that considers both economic factors and trend factors. The base definition is public, and the author proposed several extensions. Ideally the base model would be part of P123, but I think as a starter for sector rotation we would want to include market timing.


I think you have same great ideas. Actually, I think they are all great ideas. No one is interested in doing it exactly like I do so I will spare people most the details. But my trading is inspired by almost all of your ideas.

You are probably already familiar with Meb Faber’s work such as this: Relative Strength Strategies For Investing

But I am a strong believer that the most persistent thing in the market is volatility—for a while at least. That being the case, one should look at risk parity strategies at a minimum. If you believe correlations can persist then other strategies using Modern Portfolio Theory can—at least—be considered.

So 2 things that I use and you may want to look at:

  1. Most of what is in you post can be done easily at this site (e.g., double momentum, relative risk): Portfolio Visualizer

BTW, a lot can be accessed for free at this site. If you wanted to get up to date recommendations for a market-timing strategy or uploading data from a port at P123 you can do this for a fee.

  1. Here is a book that may interest you. It can probably be called a mix of Meb Faber’s work and Modern Portfolio Theory: Adaptive Asset Allocation

It is, frankly, IMPOSSIBLE to backtest an adaptive allocation model that doesn’t have a better Sharpe ratio (also Treynor Ratio, Calmar Ratio, and Sortino Ratio) than the SP500 at Portfolio Visualizer using some of the strategies you suggest.

While one has to wonder whether you can really beat the SP500’s returns out-of-sample I am certain one can beat the risk adjusted returns of the SP500—hand down.

Once one has picked the sectors of the economy one want to be in, one can (of course) select individual equities within those sectors—using P123 if one wishes. Or even a Chaikin Power Gauge.

BTW, something similar to the Chaikin’s Power Gauge is free at Fidelity. Unlike the Chaikin Power Gauge the results are completely out of sample while the Chaikin Power Gauge’s published results includes backtesting: something Marc used to be against. Chaikin Analytics is pretty expensive. Greater than $2,000 per year. Fidelity’s version is the Equity Summary Score powered by StarMine.

Anyway, I like all of your ideas and I use many of them in my investing already.

A more complex way of doing this is with Bayesian theory. There is a lot of discussion of this in the literature. But the main reasons that people look to Bayes theory is that using historical data has 2 problems. First, using historical returns provides too much error in the calculation. Second, even if you use something like the minimum variance portfolio that does not have returns in the calculation then a portfolio can become too concentrated.

Using relative strength gets around using the historical returns. One just selects the stocks one expects to outperform without entering the expect return in the calculations.

Becoming too concentrated in some sectors can be addressed by keeping a portion of your portfolio is well diversified assets (without timing or adaptive strategies). Bayesian theory may allow one to quantitate this but ultimately adjusting this to your risk tolerance may be the better method anyway. It may give you a solution that you can stick with long-term without the complex computer programming required for a full Bayesian analysis. While I believe it is unnecessary, that does not stop me from working on the full Bayesian analysis—just for kicks.



Another good resource for for risk parity is Resolve Riffs podcast if you don’t want to buy the book or don’t like reading. There are some good free research papers on their website.

The best do it yourself risk parity site I have found is They have many sector rotation strategies you can look at or create your own.

If anyone else knows of any other do it your self risk parity sites please post.

If P123 adds dynamic allocation and weightings of ETFs based on rules it will be a big win.

Looks like Kurtis Hemmerling has read the book and discussed it over at SeekingAlpha (using P123 Books at times in the article): [url=][/url]

Thanks Jim,

I am able to model leveraged models with risk parity and taking a 45% drawdown does not seem tolerable to me. But if you take that leverage and only apply it to 5% of your assets it’s a great little boost that I can live with. I obviously cannot model it like Resolve they have every possible asset class all over the world. The podcast introduced me to another investment manager called Diego Parrilla. He basically says the only guaranteed protection from the next blow up is put options on every asset class. He is also long on gold and hard assets. Options have drag that eat your returns and it’s hard to roll options seems like a lot of work but if it was easy everyone would do it. If my work slows down I will take the next couple of years to learn.


I get a little leverage with an ETF called RPAR. I am limited in how I can get leverage because I invest in a SEP-IRA.

RPAR is a risk parity fund that leverages up the bond portion of the fund to have equal risk for bonds, commodities and equtities.

They get the leverage with futures which may be better than 2X or 3X funds because of the volatility-drag these funds have.

This is just a portion of my portfolio. I use it to get some leverage and to avoid being too concentrated in one asset class which can happen with adaptive allocation models. I use an adaptive allocation model for most of my portfolio.

Portfolio Visualizer allows you to upload a P123 port’s returns. So a port can become a part of a risk parity model.

But I wanted to post here to make people aware of NTSX. This is a Wisdom Tree fund that leverages bonds with futures also. They claim to achieve a 90%/60% equity bond ratio. It is a bit less wonky than RPAR and may be more attractive to many at P123. It is just a mix of equities and bonds. I do not think they claim that it achieves risk parity.

Of course if you do not like their exact mix of equities and bonds or the amount of leverage you can make it part of your portfolio and adjust the ratios in your portfolio.

Wisdom tree makes public the amount of leverage so one could calculate the mix of assets—in addition to NTSX—that would create risk parity.

A very conservative person could buy AGG (or BND) along with NTSX until she achieves risk parity (or the desired level of risk) in the bond portion of their portfolio (perhaps with a bit of gold). I do not think this would have the returns of the SP500 long-term but it would be extremely low-risk and could be tailored to have better returns with less risk than the standard unlevered equity/bond portfolio.



SnortingElk, I would be game for this. I’ve recently started pay closer attention to this myself.

Hi Snorting Elk, You might check out this sector fund process posted by Walter Deemer. Sounds like it’s something he’s been running since 1986 with results shown.

He posts some of his technical observations (sparingly) on twitter. I’ve found his observations instructive.


I am confident I will produce better KPI’s than RPAR, NTSX and Resolute. Better Sharpe, CAGR, and Volatility if I don’t then it’s a waste of time. Thats why we all do this. There was talk of opening up p123 to any type of model. The designer enters their trades that would be a good test. 5 years later we evaluate the results no grave yard and see who beat the index. Imagine if it was 10k to enter I wonder how many people would enter? I’m sure the lawyers would cost 1M to get it going so it will never happen. When you put up real money you see who is actually serious about their opinions. Imagine for designer models you only pay if after 5 years it out performs the index. If not you get all your money back. 95% of pros would not do this. Thats how hard this business is. But it’s still intellectually stimulating and lots of fun. From P123 standpoint they have all my trading data and can compare that to everyone. It’s all about the data. Sounds like a win win but the law will never let this happen.


Just some thoughts on the model:

  1. Momentum → use the price momentum of the sector / industry as the trigger for allocation → slower to react, only works if the trend persists

  2. Use GDP / Inflation expectation

GDP and Inflation down → Regime 1
GDP and Inflation up → Regime 2
GDP down and Inflatin up → Regime 3
GDP down and Inflation up → Regime 4

Just some thoughts on the model:

  1. Momentum → use the price momentum of the sector / industry as the trigger for allocation → slower to react, only works if the trend persists

  2. Use GDP / Inflation expectation

GDP and Inflation down → Regime 1
GDP and Inflation up → Regime 2
GDP down and Inflatin up → Regime 3
GDP down and Inflation up → Regime 4

Problem is that it is not so easy to get those regimes right. Sometimes it is very clear (like now → GDP and Inflation up) but in other times
it is not so clear (last quater switching between regime 3 and 4).

I use both apporaches but discreationary, also I use Brave-Butters-Kelley Indexes (BBKI) - Federal Reserve Bank of Chicago

Thank you Andreas.

I am not sure I am a good discretionary trader but maybe I can at least understand what is happening to my money. I was trying to understand some of this by looking at a site Marco first introduced me to: Lyn Alden

Here is a section from one of her articles:

‘The “endgame” for the current high-debt environment will likely involve a combination of high fiscal deficit spending (monetized by central banks), cash and Treasury yields held persistently below the prevailing inflation rate, a trend shift from disinflation to inflation, and subsequently a period of currency devaluation.’

But she also makes a case for timing and/or diversification:

“However, for investors and traders, this becomes a matter of timing. The timing and magnitude of fiscal policy will play the key role in inflationary or disinflationary outcomes. Whenever they’re spending aggressively, the near-term outcome leans towards inflation. Whenever they’re gridlocked or employing austerity, the near-term outcome leans towards disinflation.”

I do not want to comment on this too much except to say that if Lyn Alden is correct (and I understand her), the FED will work to promote inflation as Andreas is predicting. Deflation could occur intermittently—for example when there is political gridlock.

I think she is also saying that bond yields will remain below inflation if the FED has anything to say about it. I assume the FED will win on this one. They can and will buy government bonds until they do win I would guess.

So my question of people who understand bonds is does this argue for including Treasury Inflation-Protected Securities (TIPS) in your bond purchases (or at least as a part of any purchase of government bonds)? You can also get leverage with TIPS using bond futures, no?

BTW, the downside in the case of deflation is limited with TIPS isn’t it? The principle returned has a floor, I think. So I guess the main downside risk in a diverse portfolio would be thinking that the FED would let yields rise above the inflation rate. Something I think the FED can and will prevent from happening. But maybe I am not right about that or I am missing another large downside risk. Maybe the convexity of bonds far outweighs the inflation protection TIPS provide even with the FED keeping yields below the inflation rate.

If Lyn Alden is correct (and my analysis of the risks is somewhat correct) does this argue for holding some TIPS? If so, how much should one hold? More generally, what bond and/or bond-fund mix do you recommend? What are people’s thoughts about bond futures to get some leverage—for risk parity or a minimum-variance portfolio say?



Consensus right now is that fiscal policy is back and that CBs will let inflation run to deflate dept and let the dollar devaluate, Gen Y and Gen Z are
huge which will be inflationary too in the US.

But I am not predicting inflation longer term. Right now we GDP is up and Inflation is up (rate of change), the trend is strong, but this still could change in a heartbeat.

Go from week to week (month to month, quater to quater) and adapt to the market.
A good sector rotation model is agnostic. From what I have learned that a bottom up approach is better then a macro opinion apporach.

You need the price confirmation anyway, so why have a macro opinion at all (which you only need if you manage billions, then you
have to be early to get into the trend. But our ports are small enough to rebalance within days or weeks).

Right now we have strong price confirmation on industrials, cycnicals, small caps, energy etc., e.g. a GDP up and inflation up signal +
a price signal on the above sectors.

But I try to stay flexible. Good example: Healthcare should right now in this environment be neutral - weak, but nano cap biotechs (with a price to book value below 1) are very strong, so I play them anyway.

Also there are very, very small new sectors that emerge and give strong trends (Canabis in 2018 etc.)

To put all this in one system I think is very, very hard. I think it is better to have like 10-20 Sector systems (all with the same parameters) + small cap + an international ADR System + China and
then playing the momentum (Capital curve, charts and fundamentals of single stocks of the system).

If you watch all those systems regualary (not only the cap curve also individual stocks) you can see the sector behaiviour and rotation and
you are in synch with the market.

So yes, it took me a while but Marc’s approach to be more discreationary (with a strong system base), but I think that is a good way.

Just read the new Market Wizzards (Unknown Market Wizzards) book. The most successfull traders in the book are the ones that
mix a systematic apporach with discreationary adaptability.

Best Regards


Thanks for all of the ideas.

I’m familiar with Generalized Protective Momentum, Risk Managed Momentum, Protective Asset Allocation, Adaptive Asset Allocation, and others. There are many different models and many similarities between many of the models.

I propose starting with a core model, that is well documented with variations. The core model can then be extended in various ways, such as correlation, macro/quad-based ETF selection, factor-based ETF selection, etc. If there are specific features that people believe should be in the core, as core variations, or as extensions, please add to this thread.


The core model seems to me to be as follows:

  1. Pick the top 3 ETFs based on a momentum score from a universe of defined ETFs and allocate to them equally
  2. Sell all the 3 ETFs a move to a single risk-off asset based on a market timing signal.
  3. Rebalance


  1. Risk-On Universe Definition: The core model will allow users to switch between different risk on ETF universes at design time.

  2. ETF Selection Count Variations: The core model will be developed such that it’s easy to switch from 1 to n ETFs during risk on at design time.

  3. Momentum Score Variations: The core model will be developed with three different functions for calculating momentum. Once these are documented, and the method for switching the momentum score is documented, it should be easy for users to create additional and increasingly complex functions. Changing the momentum function will be done at design time.

  4. Market Timer Variations: The core model will be developed with three different functions for timing the market. Once these are documented, and the method for switching the timer is documented, it should be easy for users to create additional methods. Changing the market timing function will be done at design time.

  5. Risk-Off Strategy Variations. The core model will be developed with three different functions for selecting a risk-off asset(s). Once these are documented, and the method for selection is documented, it should be easy for users to create additional methods. Changing the risk-off strategy will be done at design time.


The specific requirements for the core model need to be defined, which can be done in this thread. Then we will need a design for how to implement the requirements using P123. Then the implementation. And a document that describes how to use the core model, as well as shared sample universes, ranking systems, functions, and strategies.


I don’t really know how long it will take to develop the Core Model and Variations, but I’m hoping it can be done in a few months.


Once we have a core model that is well documented, it seems like it can serve as the basis for future extensions in a lot of different ways.


For the development of the Core Model and initial Variations, I propose to just use this thread. If people have ideas, want to develop parts and share them via this thread, etc. that would be great.

Hi SnortingElk, today is my first day on this site. I have been reviewing a few sites to see if any of them have ETF ranking capabilities base on momentum.

I’m looking to ranking ETF’s based on a momentum score (both slow and fast momentum) from a universe of defined ETFs and reallocate them on a monthly/quarterly basis. I was also wanting to look at the strongest sector in ETFs and allocate funds to the strongest sector, ie., small caps/industrials.

Anyways, I would be willing to help fund a joint project and I’m okay if it’s public as well.


Hi Scott,

Sounds like we have some common interests. I’m going to keep posting here my ideas, and links to anything I develop. There are two momentum measures I have in mind to start with. If you have some other ideas, please post.

Rank by Average Performance

[[1 Month Return] + [3 Month Change] + [6 Month Change] + [12 Month Change]] / 4

[1 Month Return]: [(Month1 Price) - (MonthN-1 Price)]/(MonthN-1 Price)
[3 Month Change]: [(MonthN Price) - (MonthN-3 Price)]/(MonthN-3 Price)
[6 Month Change]: [(MonthN Price) - (MonthN-6 Price)]/(MonthN-6Price)
[12 Month Change]: [(MonthN Price) - (MonthN-12 Price)]/(MonthN-12 Price)

Rank by Weighted Performance

12/19*[1 Month Return] + 4/19*[3 Month Change] + 2/19*[6 Month Change] + 1/19*[12 Month Change]

[1 Month Return]: [(Month1 Price) - (MonthN-1 Price)]/(MonthN-1 Price)
[3 Month Change]: [(MonthN Price) - (MonthN-3 Price)]/(MonthN-3 Price)
[6 Month Change]: [(MonthN Price) - (MonthN-6 Price)]/(MonthN-6Price)
[12 Month Change]: [(MonthN Price) - (MonthN-12 Price)]/(MonthN-12 Price)


The developer of the Generalized Protective Momentum strategy has given permission for a Portfolio 123 implementation, with the request that we link back from the implementation to the TrendXplorer website, and that I writeup an article on the implementation for the TrendXplorer website.

It’s not clear to me if it will be possible to implement GPM on Portfolio123, but I think the original GPM is well documented, and that an implementation will help with the core model.

I have a Google Sheets implementation for GPM, so I believe the requirements are clear and there is a baseline for testing.

The requirements as I understand them are as follows:

Define a Fixed Risk On ETFs Universe
• The “default” Risk On universe should be, "SPY, QQQ, IWM, EWJ, VGK, EEM, GLD, DBC, VNQ, HYG, LQD, TLT
• Calculate the 1, 3, 6, and 12 month return for each of the assets.
• Calculate the 1/3/6/12 Average Return of the 1, 3, 6, and 12 month returns for each of the assets.
• Calculate the average 1 month return for the entire basket of risk on assets.
• Calculate the prior 12 month correlation between the 1 month return for each asset and the basket average
○ The idea is to calculate the prior 12 month correlation for each asset with the overall basket, because
• Calculate the Correlation Adjusted Return for each asset by multiplying its 1/3/6/12 Average Return by (1-correlation)

Rank the Risk On ETFs
• Rank the ETFs in the risk on universe using the Correlation Adjusted Return

Define Canary Universe Of ETFs
• The “default” Canary Universe should be, "SPY, QQQ, IWM, EWJ, VGK, EEM, GLD, DBC, VNQ, HYG, LQD, TLT
• In the simplest case, the Canary Universe equals the Risk On Universe, but for flexibly, they will be defined separately.
• Calculate the Correlation Adjusted Return for each of the assets in the canary universe
• NOTE: The definition of the canary universe is important, because it will be used for signaling risk of.

Define a Risk Of Universe of ETFs
• The “default” risk off universe should be SHY, IEF
• Calculate the Correlation Adjusted Return for each of the ETFs

Calculate the % for Risk Off
• If there are 12 assets in the Canary Universe, then calculate the number that have a Positive Correlation Adjusted Return
• The % allocation to Risk Off equals (Min (12-# Of Canary Assets with Positive Return) / 6, 1))
○ If 12 of the Canary Assets have positive return, min ((12-12)/6, 1) = 0% Risk Off
○ If 11 of the Canary Assets have positive return, min ((12-11)/6, 1) = 16.67% Risk Off
○ If 10 of the Canary Assets have positive return, min ((12-10)/6, 1) = 33% Risk Off
○ If 9 of the Canary Assets have positive return, min ((12-9)/6, 1) = 50% Risk Off
○ If 8 of the Canary Assets have positive return, min ((12-8)/6, 1) = 66.67 % Risk Off
○ If 7 of the Canary Assets have positive return, min ((12-7)/6, 1) = 83% Risk Off
○ If 6 of the Canary Assets have positive return, min ((12-7)/6, 1) = 100% Risk Off

Buy Rule
• Buy the three ETFs from the Risk On Universe with the Highest Correlation Adjusted Return
○ Buy Amount = (100% - Risk Off % / 3). So if Risk Off % = 0, then allocate 33% to each. If Risk Off % = 50%, then allocate 16.5% to each, etc.
• Buy the single ETF from the Risk Off Universe with the Highest Correlation Adjusted Return
○ Buy Amount = (Risk Off %)

Rebalance at the end of each month

Check the disclaimer for the GPM model:
“NB! All results in this contribution are derived from synthetic monthly total return data constructed by us …”

So how do you get a synthetic return from 1970 onward for QQQ, EWJ, VGK, EEM, DBC, VNQ, HYG, LQD, TLT ?
If anybody has the such data please post it here and show how it was derived.

From the “default” Risk On universe only SPY and GLD can reliably be reproduced over this long period.

Here is my own simple Sector Rotation model - The iM Seasonal ETF Switching Strategy. A simulated 19% annualized return since 1999, and positive returns every year.
This is a lot simpler than trying a GPM model.

Hi MV,

I bumped into this website named, it offers great rotational strategy. You might want to check it out as well. Please let me know your thoughts.

BTW, I use as well, but not as a paid member. Can I customize my own strategy by selecting my favor ETFs? Their website has a list of pre-selected ETFs, but I want to build a strategy with my own picks. Do I need to use their QuantTrader platform to build the strategy?

Best regards,

Hello Smartleo,

I will check out but in my experience until you use a tool for a couple of years you don’t know how good it is. you need Quantrader to build your own.