Trend Composite Strategy (Part 3) – Portfolio Level Testing, StochClose Ranking, Market Regime Filter, Optimizing Number of Positions

Today’s article is the third installment of the Trend Composite series, which is working towards a trend-momentum strategy for trading ETFs. Today we will move from “All Signals” testing to portfolio level testing. We will first use uptrend/downtrend signals and employ StochClose as a ranking filter. With 85% of the ETFs in the test universe tied to the equity market, we will then show the importance of a Market Regime filter.

Note that the Trend Composite is part of the TIP Indicator Edge Plugin for StockCharts ACP. I use Amibroker because this is where I can build the indicators, test the indicators and fully customize the chart views.

The charts are linked to a SharpChart with corresponding indicators or the SharpChart alternatives. Note that CCI is used instead of CCI Close, Full Stochastic (125,5,1) is used instead of StochClose (125,5) and the thick black line is the 125-day SMA.  

StochClose for Ranking

The Trend Composite is used to generate the buy/sell signals and StochClose is used as a tiebreaker when needed. The Trend Composite triggers a buy when it crosses from negative to positive and sell when it crosses from positive to negative.

When trading a portfolio, there are sometimes more signals than available positions. For example, we may have three new signals, but only one spot available for a position. In this case, the ETF with the highest StochClose value is chosen.

The charts below show the Energy SPDR (XLE) and the Oil & Gas Exploration & Production ETF (XOP) with bullish signals on November 24th, 2021 (green arrows). StochClose was 49.43 for XLE and 46.02 for XOP. XLE had a higher StochClose value and would win in a tiebreak.

Note that choosing the ETF with the highest StochClose value does not guarantee that it will outperform the ETF with the lower value. In fact, XOP was up more than twice as much as XLE on the example above. The red arrows show the sell signals when the Trend Composite turned negative.

Nevertheless, we need some sort of tiebreak mechanism and it makes sense to choose the ETF with the highest StochClose value. StochClose measures the location of the close relative to the high-low range. Higher values imply stronger price charts. This tiebreak becomes more important when we move to the momentum driven portfolio later in this series.

The energy-related ETFs are highly correlated and six triggered Trend Composite buy signals from November 18th to 25th (2020). The Oil & Gas Equipment & Services ETF (XES) was the first, while XLE and XOP were last. The DB Energy ETF (DBE) triggered bullish a month earlier (August 26th). It would not make sense to hold all seven energy related ETFs in an ETF portfolio with 10 to 20 positions in total – unless you wanted a big bet on energy. Three would be the max for me and I would spread these out accordingly: the commodity (DBE), the majors (XLE) and one others (XES, XOP or FCG).

ETF Universe

The testing will cover 97 ETFs that have trading history back to at least 2007. We need a long trading history that includes at least one market cycle for an effective test. The period since 2007 includes the bear market in 2008-2009, the covid crash in March 2020 and some other eventful declines. 18 of the 97 have trading history back to at least 2007 and the rest have trading history back to at least 2006.

14 Non Equity ETFs

AGG, DBA, DBB, DBC, DBE, GLD, IEF, IEI, LQD, MBB, MUB, SLV, TIP, TLT

83 Equity-Related ETFs (includes 2 junk bond ETFs)

CGW, CUT, DIA, FCG, FDN, GDX, HYG, IBB, IGE, IGN, IGV, IHF, IHI, IJJ, IJK, IJR, IJS, IJT, ITA, ITB, IVE, IVW, IWC, IWD, IWF, IWM, IWN, IWO, IYR, IYT, IYZ, JNK, KBE, KIE, KRE,  MDY, MOO, PBD, PBJ, PBW, PFF, PHO, PPA, PSP, QCLN, QQQ, RCD, REM, REZ, RGI, RHS, RSP, RTM, RYE, RYF, RYH, RYT, RYU, SDY, SHY, SLX, SOXX, SPHQ, SPIP, SPY, SUSA, VIG, XBI, XES, XHB, XLB, XLE, XLF, XLI, XLK, XLP, XLU, XLV, XLY, XME, XOP, XRT, XSD

Strategy Parameters

  • Test period: 1/1/2007 to 1/31/2022 (15 years)
  • 97 US ETFs with trading history back to at least 2007
  • 14 Equal-weight Positions
  • Trend Composite Signals based on closing prices
  • Use StochClose value for tiebreak (highest wins)
  • Buy/Sell based on opening prices the next day
  • Commission: $5 per trade (buy/sell = two trades)
  • Slippage: 2.5 bps or .0025 percent per trade
  • No dividends (article explaining why)

Key Performance Metrics

The Gain/Loss Ratio is the Average Gain divided by the Average Loss. This one is pretty straight forward. Trend-followers would like to see this ratio above 3.

Profit Factor equals the number of winners multiplied by Average Gain divided by the number of losers multiplied by the Average Loss. A Profit Factor of 2 means total profits are outpacing total losses by a two to one margin.

Expectancy, which is similar to Profit Factor, is a performance metric based on the Win Rate, Average Gain and Average Loss. If the Win Rate is below 50%, then the Average Gain needs to be higher than the Average Loss to generate positive expectancy. Strategies with low Win Rates, say 30%, need an Average Gain that is much larger than the Average Loss to offset the high Loss Rate, which is 70% when the Win Rate is 30%.

Setting the Benchmarks

The table below shows the performance for buy-and-hold using SPY and the 97 ETFs (equal-weight positions). SPY outperformed with an 8% Compound Annual Return (CAR), but had a slightly higher Maximum Drawdown (56.5% vs 49.3%). Trend-following strategies with ETFs do not always beat buy-and-hold for the Compound Annual Return, but they get pretty close and the drawdowns are much more tolerable (16-18% vs 50-56%).

Trend Composite Signals without Market Regime

The first test takes Trend Composite signals regardless of the Market Regime (bull market for stocks or bear market). The Compound Annual Return (CAR) was 5.5% and the strategy was invested 89% of the time. This high exposure led to a relatively high drawdown (27.3%) and a Profit Factor well below 3.

Trend Composite Signals with Market Regime

Keep in mind that 83 of the 97 ETFs in the universe are equity-related and this means they are highly correlated with broad market movements. The second test takes buy signals ONLY when the Market Regime is bullish (Composite Breadth Model). Buy signals are ignored when the Market Regime is bearish. The results are much improved with a 7.32% Compound Annual Return, a much lower Maximum Drawdown (17%) and big improvements in the Gain/Loss Ratio, Profit Factor and Expectancy.

Note that the equity-related ETFs are not sold indiscriminately when the Market Regime turns bearish. They are sold when/if their Trend Composite turns negative (sell signal).

Returns and Drawdowns

The next chart shows the equity curve for the portfolio (green line) and the equity curve for buy-and-hold SPY. The portfolio avoided the 2008-2009 bear market and then outperformed until 2019. SPY is currently outperforming, but the Portfolio is not far behind.

The next chart shows the drawdowns with the largest in 2009. Drawdowns since 2010 have been in the 12-14 percent area. The drawdown is the maximum decline from the high of the portfolio.

The next table shows the monthly and annual returns. There were six down years and nine up years. The biggest loss on a down year was 6.6% and the biggest gain on an up year was 24.4% (2020). Seven of the nine up years experienced double digit returns.

Elsewhere, notice that the big gain in 2013 (+29.3%) is sandwiched by four down years. May and June are the only down months (last line). This fits with the best six months strategy (sell in May and go away). I do not use seasonal patterns in my strategies because the trend signals dictate.

It is clear from the charts and numbers above, that this basic trend-following strategy can go through long periods of flat trading, and even experience some down years. The down years were relatively contained and this means the portfolio remained at a relatively high level when the up years followed. Notice that we have currently experienced three up years straight with an average return of 16.2%. This means we could be in for a rough stretch in 2022.

Experimenting with Number of Positions

The table below shows the signals since June 2020 and the green shading shows the currently active signals. Four are energy-related (XOP, RYE, IGE, XES). There are active signals for the DB Base Metals ETF (DBB), the Bank SPDR (KBE) and Utilities SPDR (XLU).

The strategy did not pick up buy signals in the DB Agriculture ETF (DBA), DB Energy ETF (DBE) and Gold SPDR (GLD) because there were no available spots in the portfolio when they triggered or another ETF won the tiebreak. One could expand their portfolio on a case-by-case basis, but this brings in a discretionary aspect.

As far as backtesting and a systematic approach are concerned, we see higher returns and drawdowns with fewer positions, and lower returns and drawdowns with more positions. The table below shows performance for 10, 12, 14, 16, 18 and 20 positions. The Compound Annual Return (CAR) declines from 7.96% to 6.85% as the number of positions increases. The Maximum Drawdown (MDD) falls from 17.7% to 15.4%. The slight deterioration in performance appears to be related to the decline in the Average Gain (from 18.73% to 17.49%).

Conclusions

Trend-following is all about patience and sticking with the strategy through thick and thin. There will be thin periods, such as the down years in 2011-2012, 2015-2016 and 2018. There will also be thick periods, such as the last three years. Overall, the trend-following strategy kept pace with buy-and-hold and managed to avoid the big drawdowns (2009, 2020). Note that these metrics do not include dividends so the Compound Annual Return (CAR) is probably a little higher (icing on the cake).

Avoiding the drawdown may not seem like a big deal right now, but we still need a strategy for when the market turns sour. As Mike Tyson famously said: Everybody has a plan until they get punched in the face. The difference, as always, is in the execution of that plan. Plan to get punched, have a plan for this event and execute that plan. Oh, and write it down! You can also type it. 

Thanks for tuning in and have a great day!
Scroll to Top