Category: Regime Change

Relative Strength Composite backtesting with a regime switch

We have added an RS Composite option to the Regime Relative Strength backtest.

Annual subscribers (both pro and regular) can now switch from using regular 3-factor RS models to RS Composite models by turning on the RS Composite option.


click image to view full size version


For more detail on the difference between the 3-factor Relative Strength model and RS Composite, see Relative Strength: 3 Factor vs Composite

Go to the Regime Relative Strength backtest


Using SPY as a regime switch

A question that we receive with some regularity is "can I run a backtest that changes strategy based on whether SPY is above or below its 200-day Moving Average?"

The answer is yes. We have a group of backtests that switch between strategies depending on the prevailing regime.  These regime backtests build up on the logic of the Ratio MA backtest and come in 2 varieties:

With these two backtests, when the ratio is above its MA the backtest runs the Regime 1 portfolio / RS strategy (i.e. Risk On).  Conversely, when the ratio is below its MA, the Regime 2 (Risk Off) portfolio is chosen.

If, rather than using a ratio, you want to switch strategy based on whether or not SPY alone is above / below its 200-day MA,  then you can use XZERO as the Regime 2 security.

XZERO is simply a zero return index (i.e. it's a constant), so an MA of the ratio SPY / XZERO is the same as a moving average of SPY itself (see the Parameter Summary comparison at the bottom of this post).


Regime RS backtest that uses the SPY 200-day MA to determine the regime

Note:  Moving Averages on ETFreplay are calculated using Total Return.  i.e. the calculation does not just use closing prices but also accounts for the receipt and reinvestment of any dividends and distributions.  The MA is then compared to the Total Return value of the ETF, so that it's like-vs-like; everything is Total Return, not just price.



SPY MA Parameter Performance Summary on the left. SPY / XZERO Ratio MA Parameter Summary on the right. The backtest returns are the same.

Using a Regime Ratio to switch between Mean Reversion and Relative Strength strategies

This example employs a simple credit spread style ratio to define the prevailing risk on / off regime and uses that to switch between different strategies.

When the High Yield / Treasury ratio is trending upwards (i.e. short MA above long MA) the backtest pursues a mean-reversion strategy, investing in the weakest short-term performers (buying wholesale) in a list of broad U.S. equity ETFs.

Conversely, when the HYG / IEI ratio trends down (short MA below long MA), the backtest switches to a Relative Strength strategy; buying the top five from a list of mixed asset class ETFs.   Selecting the strongest five securities from the list provides some diversification while also giving the backtest the opportunity, in bear markets, to allocate 80% to fixed income and, in the most severe periods, to avoid equities entirely. 



Specific parameters and ETFs are not the focus of this example, rather, it is intended to highlight the backtest functioanlity and to provide a starting point for subscribers to further research and develop.

Using a Regime ETF Backtest To Address Market Cap Weighting Skewing Benchmark Returns

This model is simple yet addresses an important issue for those that want to compete against a benchmark.

In order to compete against a specific benchmark, it makes sense to understand that benchmark.   If you totally ignore it, you can do great but at times you will probably get frustrated because your strategy is totally out of sync.

So take the example of a logical model of  S&P Equal Weight vs NASDAQ Equal Weight.   This is a pretty good indicator but at the same time, the S&P Equal Weight is wildly different portfolio than the weighted S&P because of the fact that market weight S&P is strongly skewed to the big, very profitable money-making S&P names (AAPL, AMZN, MSFT etc).  

This backtest addresses that by using our Regime model.  It still uses S&P EW vs NASDAQ EW as its indicator -- but then when it comes to actually buying and selling, it uses market cap weighted QQQ and market cap weighted OEF (S&P 100).  

Take a look;

Regime Driven Mean Reversion

Late last year we produced a video that showed how two different strategies, relative strength and mean reversion, could be layered on top of each other.  That example went through each of the constituent backtests separately, in order to explain the mechanics of the process.

The example below shows how such a dual-layered strategy can be run in a single backtest.  The first layer employs the SPY / VEU ratio moving average as a regime switch to dynamically alternate between whichever is stronger; U.S. or International stocks.  Then, the second layer picks the weakest short-term performer within that chosen asset class.

To keep it simple, we have used the same basic U.S. (MDY, IWM, SPY and QQQ) and international (EWA, EWC, EWH and EWS) ETFs that we have used in previous examples.