Welcome to QuantHead!
Welcome to QuantHead! I hope you find some interesting ideas here that I've encountered on my journey of learning and share your wisdom with me. Enjoy!
Sunday, February 1, 2015
Monday, January 26, 2015
Cliff Smith Quarterly Tactical Asset Allocation
Jan 30, 2015 Update: Thanks to a reader, the spreadsheet has been corrected to use 3-month SMA instead of 63-day SMA as the filter.
Here's another quarterly rotation strategy that Cliff Smith presented on Seeking Alpha and backtested on ETFreplay.com, resulting in a CAGR +28.7% and Max Drawdown of -19.1%. The idea is to invest in the top asset of a basket of seven funds (or their corresponding ETFs) at the beginning of each quarter (January, April, July, October), unless the adjusted close price of the top ranking asset at the time of switching is below its 3-month simple moving average, in which case the allocation is VUSTX (or TLT/TLO).
The rankings are based on 105-day returns (weighted 50%) and 20-day returns (weighted 50%), based on adjusted close data from Yahoo Finance. As usual, I've created an automatically updating, dynamic Google Spreadsheet to help with the rotations.
QH Cliff Smith Quarterly TAA Spreadsheet
Here's another quarterly rotation strategy that Cliff Smith presented on Seeking Alpha and backtested on ETFreplay.com, resulting in a CAGR +28.7% and Max Drawdown of -19.1%. The idea is to invest in the top asset of a basket of seven funds (or their corresponding ETFs) at the beginning of each quarter (January, April, July, October), unless the adjusted close price of the top ranking asset at the time of switching is below its 3-month simple moving average, in which case the allocation is VUSTX (or TLT/TLO).
The rankings are based on 105-day returns (weighted 50%) and 20-day returns (weighted 50%), based on adjusted close data from Yahoo Finance. As usual, I've created an automatically updating, dynamic Google Spreadsheet to help with the rotations.
QH Cliff Smith Quarterly TAA Spreadsheet
Thursday, January 22, 2015
Simple Pair Switching Google Spreadsheet
I've created an automatically updating Google spreadsheet for the previously introduced strategy "Simple Pair Switching", for those that don't have access to the Thinkorswim platform (or like me, who find it slower to login and load to TOS than load a web page).
The numbers in the ranking column don't match the values of TrendXplorer's TOS study. However,
I went back a few years, and the signals are pretty much spot on at the same exact places.
I used non-adjusted daily close data to stay faithful to TX's original study.
QH Simple Pair Switching Spreadsheet
The numbers in the ranking column don't match the values of TrendXplorer's TOS study. However,
I went back a few years, and the signals are pretty much spot on at the same exact places.
I used non-adjusted daily close data to stay faithful to TX's original study.
QH Simple Pair Switching Spreadsheet
Sunday, January 18, 2015
Universal Rotation System Backtesting Tool v0.51
Feb 02, 2015 Update: Thanks to a reader, the tool has been fixed to correctly display rankings with 7+ assets.
Right then, here it is: "Universal Rotation System Backtesting Tool".
It attempts to execute a similar process as Portfolio Visualizer and the ETFreplay.com, without being limited to backtesting to the end of the previous year, or a subscription fee.
Having already put quite a bit of effort into it, I'm hoping that this will become an open source project, where anyone who wants to take a shot at fixing or making it better, can share their work with others.
In addition to fixes/making it more intuitive, my hope is that folks will want to expand on this, add more variables, including volatility (and weighting for the volatility), multiple aggregation/ performance periods with weightings, as well as "Top 2" and "Top 3" as options, cash stop and moving average filters, or whatever else they might think is useful. If you are inspired to update the latest version in any way, please send me an updated version and I'll upload the latest version for everyone's benefit and to build upon in future updates.
Note that of the yellow fields, which contain variables that can be changed, currently everything but the "Top 1" field is active. ONLY change the data in the yellow fields. Also worth noting is that you have to enter a start/end date that's after the actual start/end date of the aggregation period data point: meaning, if you select 9/1/2014 as the starting date for a monthly strategy, but as the period didn't start until 9/2/2014 because of Labor Day being on the 1/9/2014, you'll get error messages. In which case, you can for example select 9/2/2014 or 9/3/2014 instead, and it'll work fine.
There is enough "space" for 20 years of monthly backtesting, but the space for longer backtest periods may become limited when backtesting weekly strategies (also an area to expand on in the future). You can backtest to an earlier point in time than where all the assets have data from, however these assets are obviously not taken into account before they existed (populating synthetic data for any missing asset data might be an area to expand on in the future). The first asset should in these cases be the oldest asset, since the date is drawn from the "Asset1" tab.
As usual, I don't guarantee any of the data or calculations presented being correct and this tool should only be used as an informational device. Please let me know if you spot any errors, or want to improve on this but need more information on how the tool "does its magic"!
QH Universal Rotation System Backtesting Tool 0.51
Right then, here it is: "Universal Rotation System Backtesting Tool".
It attempts to execute a similar process as Portfolio Visualizer and the ETFreplay.com, without being limited to backtesting to the end of the previous year, or a subscription fee.
Having already put quite a bit of effort into it, I'm hoping that this will become an open source project, where anyone who wants to take a shot at fixing or making it better, can share their work with others.
In addition to fixes/making it more intuitive, my hope is that folks will want to expand on this, add more variables, including volatility (and weighting for the volatility), multiple aggregation/ performance periods with weightings, as well as "Top 2" and "Top 3" as options, cash stop and moving average filters, or whatever else they might think is useful. If you are inspired to update the latest version in any way, please send me an updated version and I'll upload the latest version for everyone's benefit and to build upon in future updates.
Note that of the yellow fields, which contain variables that can be changed, currently everything but the "Top 1" field is active. ONLY change the data in the yellow fields. Also worth noting is that you have to enter a start/end date that's after the actual start/end date of the aggregation period data point: meaning, if you select 9/1/2014 as the starting date for a monthly strategy, but as the period didn't start until 9/2/2014 because of Labor Day being on the 1/9/2014, you'll get error messages. In which case, you can for example select 9/2/2014 or 9/3/2014 instead, and it'll work fine.
There is enough "space" for 20 years of monthly backtesting, but the space for longer backtest periods may become limited when backtesting weekly strategies (also an area to expand on in the future). You can backtest to an earlier point in time than where all the assets have data from, however these assets are obviously not taken into account before they existed (populating synthetic data for any missing asset data might be an area to expand on in the future). The first asset should in these cases be the oldest asset, since the date is drawn from the "Asset1" tab.
As usual, I don't guarantee any of the data or calculations presented being correct and this tool should only be used as an informational device. Please let me know if you spot any errors, or want to improve on this but need more information on how the tool "does its magic"!
QH Universal Rotation System Backtesting Tool 0.51
Friday, January 16, 2015
Universal Rotation System Backtesting Tool
Here's a little teaser preview of what I've been working on lately:
I started building a dynamic Google spreadsheet to test out rotation strategies.
It currently allows you enter the assets (max.10), aggregation period (weekly, monthly, quarterly), performance period, start date and end date. For example If you select "Monthly" as the aggregation period and enter "3" as the performance period, the backtest will look at the assets' relative performance over 3 months. As soon as any variable is changed, the spreadsheet will pull data from Yahoo Finance, and populate backtest results, showing the allocations for each period, the returns for those allocations and an equity curve and stats for the backtest period. It will also show the equity curve and annual return of SPY as comparison.
The idea is, time and energy allowing, to eventually add more variables, including volatility (and weighting for the volatility), multiple aggregation/performance periods with weightings, as well as "Top 2" and "Top 3" as options.
I started building a dynamic Google spreadsheet to test out rotation strategies.
It currently allows you enter the assets (max.10), aggregation period (weekly, monthly, quarterly), performance period, start date and end date. For example If you select "Monthly" as the aggregation period and enter "3" as the performance period, the backtest will look at the assets' relative performance over 3 months. As soon as any variable is changed, the spreadsheet will pull data from Yahoo Finance, and populate backtest results, showing the allocations for each period, the returns for those allocations and an equity curve and stats for the backtest period. It will also show the equity curve and annual return of SPY as comparison.
The idea is, time and energy allowing, to eventually add more variables, including volatility (and weighting for the volatility), multiple aggregation/performance periods with weightings, as well as "Top 2" and "Top 3" as options.
Thursday, January 8, 2015
Dynamic Google spreadsheets
I've created automatically updating, dynamic Google spreadsheets for various previous strategies, including GMR, GTCR, Simple GMR and Fidelity Sector Rotation. All of these use adjusted close data from Yahoo Finance. Links to the spreadsheets can be found under the corresponding strategies.
Monday, January 5, 2015
Modified Dual Momentum
Jan 6, 2015 Update: The spreadsheet has been updated to take volatility into account in the rankings.
May 9, 2015 Update: Thanks to a reader, the 63-day volatility for TLT now points to the right data.
May 20, 2015 Update: Thanks to Gene Wildhart, the volatility calculations have been changed.
Gary Antonacci recently published a book "Dual Momentum Investing" that has raised quite a bit of discussion in the quantitative investing community. The idea was that he combined relative momentum (how assets are performing compared to each other) and absolute momentum (how assets are performing in comparison to short-term treasuries). He backtested his strategies with decent results over the last almost 40 years, but because the U.S. stock market has been so strong in the last few years, the strategies have lagged, compared to the U.S. stock market. For a lot of people, myself included, the goal is to beat the U.S. stock market and it's hard sticking to a lagging strategy year after year.
Scottsinvestments.com created a strategy inspired by Antonacci's Dual Momentum, but it has also lagged the U.S. stock market in the last few years, providing an annualized return ~ +8% over the last 5 years.
After reviewing Antonacci's book, Lowell Herr from ITA Wealth Management stepped up and modified the dual momentum strategy to have a better performance over the last few years, by increasing the number of securities for inclusion in the portfolio, shortening the look-back period and rebalancing every 33 days, which has the rebalancing date float throughout the month, rather than always at a specific date. Whether these changes are curve-fitted to improve the performance in certain conditions, or improvements leading to a robust strategy, remains to be seen going forward.
In Lowell's model, a 50% weight is assigned to 3 month (quarterly) performance, a 30% weight to 6 month performance and a 20% weight to 63-day volatility. Every 33 days equal amounts are invested in the top 2 ranked securities, unless the ranking is worse than SHY (cash), in which case one or both securities are replaced with SHY (cash). The green curve below is his backtest with these figures, providing ~+20% CAGR over the last 8 years.
I created an automatically updating Google Spreadsheet that shows the current rankings, based on the same weights of performance and volatility as Lowell uses. It will highlight the top 2 assets in green, unless their performance is worse than SHY. All assets ranked below SHY are highlighted in red. All one needs to do is check the spreadsheet every 33 days or so and re-allocate to the (new) green securities.
Schwab commission free substitutes are also provided.
Fidelity Sector Quarterly Rotation
Jan 8, 2015 Update: By a reader's request, I've also created an automatically updating Google spreadsheet, which uses adjusted close prices.
On a previous post highlighting Seeking Alpha contributor Varan's strategies, I touched on a strategy called "Fidelity Sector Rotation". This strategy looks at the 8-week performance of 44 Fidelity Sector funds and a Vanguard Long-Term Treasury fund at the close of the first week of each quarter, and invests in the top performer for the following quarter.
Varan backtested the strategy for the period 1991-2011 with CAGR +25% with a maximum annual loss of -11%, beating the S&P500 index in 17 out of 21 years. Forward-testing it up to date, the strategy returned +1.74% in 2012, +38.5% in 2013 and+ 18% in 2014.
To help with the rotations, I created a ThinkOrSwim study that automatically updates and shows the current leader of the basket. All one has to do is to check this after the close of the first week of each quarter (first week of January, April, July and October). The only difference to Varan's study is that the prices used are close prices and not adjusted close prices (dividends and splits not taken into account).
The funds are commission-free with a Fidelity account, but since I don't have a Fidelity account,
and fund commissions are somewhat bigger for me than ETF commissions, I also created a list of ETF substitutes. It is worth noting though that some of the ETFs track the corresponding fund's performance better than others, so to use the strategy in its most pure way, the sector funds should be used, rather than the ETFs.
QH Fidelity Sector Rotation TOS Study
QH Fidelity Sector Rotation Spreadsheet
On a previous post highlighting Seeking Alpha contributor Varan's strategies, I touched on a strategy called "Fidelity Sector Rotation". This strategy looks at the 8-week performance of 44 Fidelity Sector funds and a Vanguard Long-Term Treasury fund at the close of the first week of each quarter, and invests in the top performer for the following quarter.
Varan backtested the strategy for the period 1991-2011 with CAGR +25% with a maximum annual loss of -11%, beating the S&P500 index in 17 out of 21 years. Forward-testing it up to date, the strategy returned +1.74% in 2012, +38.5% in 2013 and
To help with the rotations, I created a ThinkOrSwim study that automatically updates and shows the current leader of the basket. All one has to do is to check this after the close of the first week of each quarter (first week of January, April, July and October). The only difference to Varan's study is that the prices used are close prices and not adjusted close prices (dividends and splits not taken into account).
The funds are commission-free with a Fidelity account, but since I don't have a Fidelity account,
and fund commissions are somewhat bigger for me than ETF commissions, I also created a list of ETF substitutes. It is worth noting though that some of the ETFs track the corresponding fund's performance better than others, so to use the strategy in its most pure way, the sector funds should be used, rather than the ETFs.
QH Fidelity Sector Rotation Spreadsheet
Saturday, January 3, 2015
2014 Year in Review
Feb 01, 2015 Update: Thanks to a reader, a couple of typos have been corrected in the GMR returns.
It's time to see what worked and what didn't for 2014, in order to adjust going forward. The disappointing news is that most of the ETF rotation strategies I follow, greatly underperformed, if compared to just holding the US stock market (SPY) or utilizing the "KISS Low Volatility Rotation" strategy, which basically had you invested in SPY for the entire year. The only rotation strategy that narrowly beat the market was "Simple Pair Switching".
Of the other strategies, "Buy the Dips" worked well throughout the year and so did "Hedged Convexity Capture".
Benchmark (SPY): +12%
KISS Low Volatility Rotation: +12%
Global Market Rotation: +3%
Global Transportation with Commodities Rotation: +5%
Simple GMR: +4%
Simple Pair Switching: +13%
A bit disappointing for the rotation strategies that backtested to beat the market every year.
A good lesson for the new year to stay diversified with various strategies and good reminder that
even with rigorous backtesting, past performance doesn't necessarily indicate future performance.
Below is the breakdown of the signals, returns and cumulative returns for the rotation strategies for 2014.
Wednesday, December 31, 2014
Monday, December 1, 2014
"Buy the Dips" Google Drive Watchlist
April 9, 2015 Update: Now that the new Google Sheets supports all the required features, the watchlist has been updated to the new Google Sheets format, and dividend data is now pulled from FinViz, which is more accurate and reliable than the previously used GoogleFinanceAddon plugin.
For anyone who doesn't have access to the TOS platform but wants to implement the "Buy the Dips" strategy from a few posts ago, here's a link to an automatically updating Google Drive watchlist. This copy is locked to my tickers and settings, but feel free to save a copy of your own, which you can then edit freely (File - Make a Copy).
For anyone who doesn't have access to the TOS platform but wants to implement the "Buy the Dips" strategy from a few posts ago, here's a link to an automatically updating Google Drive watchlist. This copy is locked to my tickers and settings, but feel free to save a copy of your own, which you can then edit freely (File - Make a Copy).
It's also worth occasionally checking back to previous posts, since I will keep updating/revising the strategies as I get new information.
Sunday, November 30, 2014
Short-Term Trading with Impressive Backtested Returns
One of the things in addition to racking up commission costs that I don't like about most of the short-term trading (v.s. long-term investing) strategies that I've come across, is that most of them don't backtest well across multiple assets or markets. This in my mind decreases the robustness of a strategy in a big way.
A little while ago I came across two short-term trading strategies that backtest extremely well,
with nice stable equity-curves, even through 2008. Neither of the strategies are confined to a single asset.
Both strategies require a StockFetcher.com subscription (currently about $25 / quarter) to screen for the stocks to invest in. The nice thing is that you can set up e-mail alerts for the screens, so that you get daily e-mails after the market closes with the filtered stocks listed, to be bought at the open of the next day.
The first strategy I call "ROC Buy on Dips". It is based on a technical indicator called "Rate of Change" and it filters stocks that are in an upward trend, experiencing a short-term dip. For the backtest period from January 2008 to May 2013 the CAGR was +20.65% and Max DD (realized): -6.24%. The average time held per asset was 8 days. Here's the link to read more about the details and comments on the strategy. Here's the code to use in the "My Filters" section of the StockFetcher interface:
Fetcher[
S&P 500
ROC(7,1) crossed below -2
ROC(80,1) above 20
close above MA(200)
add column ROC(7,1)
sort on column 5 ascending
draw ROC(7,1) on plot ROC(80,1)
]
The exit parameter is "ROC(7,1) > 2", which can for example checked easily on StockCharts.
The first strategy I call "ROC Buy on Dips". It is based on a technical indicator called "Rate of Change" and it filters stocks that are in an upward trend, experiencing a short-term dip. For the backtest period from January 2008 to May 2013 the CAGR was +20.65% and Max DD (realized): -6.24%. The average time held per asset was 8 days. Here's the link to read more about the details and comments on the strategy. Here's the code to use in the "My Filters" section of the StockFetcher interface:
Fetcher[
S&P 500
ROC(7,1) crossed below -2
ROC(80,1) above 20
close above MA(200)
add column ROC(7,1)
sort on column 5 ascending
draw ROC(7,1) on plot ROC(80,1)
]
The exit parameter is "ROC(7,1) > 2", which can for example checked easily on StockCharts.
The second I call "Z-Scored Reversion to the Mean". Here's the link to read more about it. For the backtest period of 1999-2009 the CAGR was +25.92% and Max DD (realized) -12.18%. Average time held per asset was 5 days, and interestingly Percent in Market was only 46.18%, meaning over 50% of the time this strategy was in cash or "risk-off".
Fetcher[
S&P500
/*FIRST DETERMINE HISTORICAL RATIO OF S&P STOCK TO THE SPY OVER THE LAST 16 DAYS*/
SET{PRICERATIO, CLOSE / IND(^SPX,CLOSE)}
SET{RATIOMA16, CMA(PRICERATIO,16)}
SET{RATIOSTD16, CSTDDEV(PRICERATIO,16)}
SET{DIFF16, PRICERATIO - RATIOMA16}
SET{ZSCORE16, DIFF16 / RATIOSTD16}
SET{THRESHOLD16, RATIOSTD16 * 2}
/*NEXT, SET CRITERIA NECESSARY TO TRIGGER A PAIR TRADE*/
SET{UPPERBAND16, RATIOMA16 + THRESHOLD16}
SET{LOWERBAND16, RATIOMA16 - THRESHOLD16}
ZSCORE16 BELOW -2
WILLIAMS %R(16) BELOW -94
CLOSE BELOW LOWER BOLLINGER BAND(16,2)
CLOSE ABOVE MA(200)
DRAW LOWERBAND16 ON PLOT PRICERATIO
DRAW UPPERBAND16 ON PLOT PRICERATIO
DRAW BOLLINGER BANDS(16,2)
ADD COLUMN ZSCORE16 {Z-score}
ADD COLUMN WILLIAMS %R(16)
DRAW ZSCORE16 LINE AT -1
DRAW ZSCORE16 LINE AT -2
DRAW ZSCORE16 LINE AT 0
SORT ON COLUMN 5 ASCENDING
CHART-TIME IS 6 MONTHS
]
/*FIRST DETERMINE HISTORICAL RATIO OF S&P STOCK TO THE SPY OVER THE LAST 16 DAYS*/
SET{PRICERATIO, CLOSE / IND(^SPX,CLOSE)}
SET{RATIOMA16, CMA(PRICERATIO,16)}
SET{RATIOSTD16, CSTDDEV(PRICERATIO,16)}
SET{DIFF16, PRICERATIO - RATIOMA16}
SET{ZSCORE16, DIFF16 / RATIOSTD16}
SET{THRESHOLD16, RATIOSTD16 * 2}
/*NEXT, SET CRITERIA NECESSARY TO TRIGGER A PAIR TRADE*/
SET{UPPERBAND16, RATIOMA16 + THRESHOLD16}
SET{LOWERBAND16, RATIOMA16 - THRESHOLD16}
ZSCORE16 BELOW -2
WILLIAMS %R(16) BELOW -94
CLOSE BELOW LOWER BOLLINGER BAND(16,2)
CLOSE ABOVE MA(200)
DRAW LOWERBAND16 ON PLOT PRICERATIO
DRAW UPPERBAND16 ON PLOT PRICERATIO
DRAW BOLLINGER BANDS(16,2)
ADD COLUMN ZSCORE16 {Z-score}
ADD COLUMN WILLIAMS %R(16)
DRAW ZSCORE16 LINE AT -1
DRAW ZSCORE16 LINE AT -2
DRAW ZSCORE16 LINE AT 0
SORT ON COLUMN 5 ASCENDING
CHART-TIME IS 6 MONTHS
]
The exit parameters are "zscore16 > -1" or "days held > 20". To know when to exit, add the stocks you've bought to a watch list called "zscore_portfolio", and use this filter to show what the current zscore16 is for the assets:
Fetcher[
watchlist(zscore_portfolio)
SET{PRICERATIO, CLOSE / IND(^SPX,CLOSE)}
SET{RATIOMA16, CMA(PRICERATIO,16)}
SET{RATIOSTD16, CSTDDEV(PRICERATIO,16)}
SET{DIFF16, PRICERATIO - RATIOMA16}
SET{ZSCORE16, DIFF16 / RATIOSTD16}
SET{THRESHOLD16, RATIOSTD16 * 2}
zscore16 above -1
]
watchlist(zscore_portfolio)
SET{PRICERATIO, CLOSE / IND(^SPX,CLOSE)}
SET{RATIOMA16, CMA(PRICERATIO,16)}
SET{RATIOSTD16, CSTDDEV(PRICERATIO,16)}
SET{DIFF16, PRICERATIO - RATIOMA16}
SET{ZSCORE16, DIFF16 / RATIOSTD16}
SET{THRESHOLD16, RATIOSTD16 * 2}
zscore16 above -1
]
The downsides of these strategies are commissions; "ROC Buy on Dips" generates about 100 trades / year, "Z-Scored Reversion to the Mean" about 220 trades / year. Add roundtrip costs (buy and sell) and at a regular broker charging $18 / roundtrip the average costs would be around $1800 / year and $4000 / year. This kind of regular trading is where you really want a discount broker, for example Interactive Brokers, where roundtrip costs would be around $2 / trade.
Friday, November 21, 2014
All-Weather Permanent Portfolio
To mix things up again, amidst introducing various rotation strategies, I recently came across an interesting article on Seeking Alpha about a permanent portfolio that backtests pretty well over the last 42 years.
The portfolio consists of 30% U.S. stocks, 15% intermediate-term treasury bonds, 40% long-term treasury bonds, 7.5% gold and 7.5% commodities. Aggregate ETF's that can be used to implement this strategy are VOO (Vanguard S&P 500), IEF (iShares 7-10 Year Treasury Bonds), TLT (20+ Year Treasury Bonds), GLD (SPDR Gold Trust) and DJP (iPath Dow Jones-UBS Commodity Index Total Return). Schwab commission-free substitutes are SCHX, SCHZ, TLO, SGOL and USCI.
The only measure required after the initial investment is an annual re-balancing of the portfolio.
I tested the strategy on Portfolio Visualizer and came up with a CAGR of +9.55% and Max Drawdown -3.35% vs. just holding U.S. stocks CAGR +10.35% and Max Drawdown -40.61%.
Yes, the CAGR is almost a percent lower than just holding stocks, however the difference in volatility is staggering. If you only looked at your portfolio once a year and suddenly noticed a decline of 40%, would you be worried, or be able to keep a cool head and hang tight? How about a decline of 3%, would you feel less inclined to sell your assets?
One of the things I like in addition to the long back-test period is the stable equity curve, which is almost at an optimal 45 degree angle. Of course to be noted is that the intra-year volatility (drawdown) can be higher than indicated in the stats or the graph.
.
The portfolio consists of 30% U.S. stocks, 15% intermediate-term treasury bonds, 40% long-term treasury bonds, 7.5% gold and 7.5% commodities. Aggregate ETF's that can be used to implement this strategy are VOO (Vanguard S&P 500), IEF (iShares 7-10 Year Treasury Bonds), TLT (20+ Year Treasury Bonds), GLD (SPDR Gold Trust) and DJP (iPath Dow Jones-UBS Commodity Index Total Return). Schwab commission-free substitutes are SCHX, SCHZ, TLO, SGOL and USCI.
The only measure required after the initial investment is an annual re-balancing of the portfolio.
I tested the strategy on Portfolio Visualizer and came up with a CAGR of +9.55% and Max Drawdown -3.35% vs. just holding U.S. stocks CAGR +10.35% and Max Drawdown -40.61%.
Yes, the CAGR is almost a percent lower than just holding stocks, however the difference in volatility is staggering. If you only looked at your portfolio once a year and suddenly noticed a decline of 40%, would you be worried, or be able to keep a cool head and hang tight? How about a decline of 3%, would you feel less inclined to sell your assets?
One of the things I like in addition to the long back-test period is the stable equity curve, which is almost at an optimal 45 degree angle. Of course to be noted is that the intra-year volatility (drawdown) can be higher than indicated in the stats or the graph.
.
Saturday, November 15, 2014
Simple Pair Switching and Multi-Asset Performance
Jan 22, 2015 Update: I've also created an automatically updating Google spreadsheet for this strategy.
Here's a similar strategy as the "KISS Low Volatility Rotation" I presented a few posts ago.
It's based on an article on Seeking Alpha by Marc Cohn: "Return Like a Stock, Risk Like a Bond",
which TrendXplorer optimized on Amibroker. With pair switching between FDVLX (Fidelity Value Fund) - VUSTX (Vanguard Long-Term Treasury Fund), he backtested the strategy to give a CAGR of 16.54% and Max DD of 14.90% during the test period of 1991-2013, with the look-back period set to 65 days and a smoothing value set to 15 days. The funds can be replaced with ETFs: SPY-TLT, MDY-TLT, SCHM-TLO (commission free on Schwab) or for a leveraged combination SSO-EDV. Notice how before the recent volatility spike in October 2014, the allocation was switched to the bond fund (VUSTX). I've attached a modified version of TrendXplorer's TOS (ThinkOrSwim) script below, which I call "Simple Pair Switching".

Inspired by Marc Cohn's article, I also created a "Multi-Asset Performance Study" for TOS, which takes up to 10 user-specified assets and looks at the performance over a user-specified look-back period. The default settings for the assets are the ETFs in the screenshot below and for the look-back period, 85-days, which Marc used in his article. The cash proxy SHY is indicated by the white line in the middle. Note that the lines don't represent current price, but the return (for example SSO 1.09 means 9% return over the last 85 days).
There are several ways one could use this as a basis for a strategy, for example: invest in a balanced, diversified basket of all assets, unless an asset is under-performing the cash proxy SHY (i.e. below the white line), in which case substitute that asset with SHY/cash. This cash-protection measure ensures that if assets become too correlated, or we enter an extended bear-market, one is either partially if not totally out of the under-performing markets.
I also included a version with smoothing, defaulting to a 65-day look-back period and a 15-day smoothing.
Simple Pair Switching Google Spreadsheet
Multi-Asset Performance ThinkOrSwim Study
Multi-Asset Performance with Smoothing ThinkOrSwim Study
Friday, November 14, 2014
Spotlight: Varan
Varan is a regular contributor at Seeking Alpha, who among other things, presents and backtests various rotation strategies. Here are some of the most interesting strategies to me that he has devised or presented over the last few years.
I have not programmed Excel sheets or TOS codes to follow these strategies. If you find any of these intriguing, feel free to do so and share!
What I generally look for in a strategy is a good return, low drawdown and long enough backtest, which includes various market conditions. Of the following strategies, I'm most intrigued by the first one, because it has a backtest history of 20 years (and being a quarterly strategy, more data-points than the tri-annual strategies), a nice return and a very low drawdown. Though to be noted with any of the strategies, is that the intra-period drawdown can be higher; the drawdown indicated only takes into account the moment of rotation.
I have not programmed Excel sheets or TOS codes to follow these strategies. If you find any of these intriguing, feel free to do so and share!
What I generally look for in a strategy is a good return, low drawdown and long enough backtest, which includes various market conditions. Of the following strategies, I'm most intrigued by the first one, because it has a backtest history of 20 years (and being a quarterly strategy, more data-points than the tri-annual strategies), a nice return and a very low drawdown. Though to be noted with any of the strategies, is that the intra-period drawdown can be higher; the drawdown indicated only takes into account the moment of rotation.
FBNDX FSUTX FSVLX FSAIX FSHOX FSENX FCYIX FSESX FSHCX FWRLX FBIOX FSAVX FSLBX FGMNX FSCSX FSRPX FIGRX FDLSX FFGCX FSDCX FSMEX FSLEX FSCGX FBMPX FSAGX FBSOX FSCPX FSPHX FSELX FIUIX FIDSX FSCHX FPHAX FSRBX FSPTX FFXSX FSTCX FDCPX FNARX FSNGX FSPCX FDFAX FSDAX FSDPX TLT (VUSTX)
- at the close of the first full week of each quarter, invest in top1 asset of best relative performance preceding 8 weeks, ending on the close of the previous week, for 13 weeks
- if the top ranked fund performed worse than TLT (bonds), invest in TLT for 13 instead
- 1991-2011 CAGR +25%, Max DD -11% (note that as with other strategies, intra-quarter drawdown can be more than 11%)
- note that these are mutual funds rather than ETFs, apart from TLT (VUSTX was used in the backtest prior to 2003 instead of TLT)
AWR AWK WTR ARTNA CTWS MSEX SJW YORW UGI WR SRE WEC ED SO BIP D NEE NGG OKE DUK
- annual rotation, first trading day of every year, select 10 assets of best annual performance prior year, if any performed worse than VBMFX (bonds), replace the assets with VBMFX
- 1991-2013 CAGR +15.3%, Max DD -12%
GAB PDI PHK ETO GPM AWF BKT MMT CEF BIF MIN TLT IEF
- every four months (first trading day of January, May and September), invest in top2 assets of best relative performance over preceding 3 months
- 1991-2013 CAGR +23.8%, Max DD -12.7%
PIXDX, PIPDX, PETDX, PCRDX, PTTDX, PFSDX and PSSDX
- every four months (first trading day of January, May and September), invest in top2 assets of best relative performance over preceding 3 months
- 2004-2013 CAGR +25%, Max DD -16%
- note that these are mutual funds rather than ETFs
WPZ, SXL, RNF, PAA, NS, MWE, KMP, EXLP, FGP, DPM, BPL, BBEP, and BWP
- every four months (first trading day of January, May and September), invest in top2 assets of best relative performance over preceding 3 months
- if either two top assets performed worse than TLT (bonds), replace one or both with TLT
- 2004-2013 CAGR +32%, Max DD -20%Thursday, November 13, 2014
Thoughts On Taxes And Commissions
One of the criticisms of rotation strategies, or any kind of active investment vs. a buy-and-hold-forever strategy is added costs involved, more specifically taxes and commissions.
Some methods to reduce or avoid taxes are to trade most actively in an IRA retirement account, where any earnings are tax-free. There are certain considerations to take into account when trading in an IRA or non-margin account. For example short-selling is not allowed, therefore one cannot execute a strategy such as the aforementioned "Hedged Convexity Capture".
Commissions vary wildly between brokerage companies. Charles Schwab charges $8.95 / trade for stocks and non-commission-free ETF's. Interactive Brokers charges around $1 / trade, however if monthly commissions are below $30, a $10 monthly market data subscription fee is collected. I've provided a table below with commission-free substitutes (at the time of this writing) for ETFs introduced in previous posts for both Schwab and TD Ameritrade. Note that the substitutes available are not exact equivalents, and there may be some price fluctuation between the assets.
For some of the ETFs there are no substitutes and a few are very illiquid, meaning a potential of a high bid-ask spread because of a low-traded volume.
KISS Low Volatility Rotation
The rotation strategies that I've introduced so far have been monthly, top1, 3-month momentum, no volatility weighting strategies. Let me explain: the usual variables for backtesting rotation models are frequency of rotation (e.g. weekly, bi-monthly, monthly, quarterly), asset quantity (e.g. invest in the top1, top2 or top3 performers at a time), momentum look-back period (e.g. x-months or x-days) and volatility (e.g. x-months or x-days).
The 3-month period momentum has worked well with various models, backtested over the last 10 years. This isn't to say though that in the future another look-back period wouldn't work better. In the interest of diversifying the look-back period and also including asset volatility in the mix (which often lowers the CAGR but also lowers the Max DD, making the strategy less volatile) I want to introduce a few other strategies, which may have not performed quite as well as some of the other strategies I've previously presented, but may or may not outperform the other strategies in the future.
First up is "KISS Low Volatility Rotation". I named it as KISS (keep it simple stupid), since rather than a big basket of ETFs, it only invests in either SPY (SPDR S&P 500 ETF) or TIP (iShares Treasury Inflation Protected Securities Bond ETF). If neither asset performs as well as holding cash, the model will rotate into cash or cash proxy SHY (Barclays 1-3 Year Treasury Fund). The return over the last 10 years has been a lot better than just holding the US total market (279% vs. 127% total return). The momentum look-back period is divided into two different look-back periods, and asset volatility is also taken into account, all with their own weightings. The CAGR is around +14%. Though quite a bit lower than in other strategies I've presented in previous posts, the Max DD is only around -13%, which is one of the lowest I've seen in models backtested for this long a period.
This strategy is very easy to implement for free, perfect if you don't prefer to deal with Excel sheets I've provided for other strategies or don't have access to the TOS platform.
Clicking on this link takes you to the ETF Relative Strength Backtest section of ETFreplay.com,
where you plug in the info from the screenshot below: First ETF: "SPY", Second ETF: "TIP", Update Schedule: "Monthly". You can select the backtest to start in "2004" if you want to see in detail how the strategy has performed. ReturnA: "6-months" (Weight: 60%), ReturnB: "36-months" (Weight: 10%), Volatility: "20-days" (Weight: 30%). At the beginning of each month you come back and check what the new asset is, for November it is "SPY" (scroll down to the bottom of the page and you see the signal was issued on Oct 31, 2014).
The 3-month period momentum has worked well with various models, backtested over the last 10 years. This isn't to say though that in the future another look-back period wouldn't work better. In the interest of diversifying the look-back period and also including asset volatility in the mix (which often lowers the CAGR but also lowers the Max DD, making the strategy less volatile) I want to introduce a few other strategies, which may have not performed quite as well as some of the other strategies I've previously presented, but may or may not outperform the other strategies in the future.
First up is "KISS Low Volatility Rotation". I named it as KISS (keep it simple stupid), since rather than a big basket of ETFs, it only invests in either SPY (SPDR S&P 500 ETF) or TIP (iShares Treasury Inflation Protected Securities Bond ETF). If neither asset performs as well as holding cash, the model will rotate into cash or cash proxy SHY (Barclays 1-3 Year Treasury Fund). The return over the last 10 years has been a lot better than just holding the US total market (279% vs. 127% total return). The momentum look-back period is divided into two different look-back periods, and asset volatility is also taken into account, all with their own weightings. The CAGR is around +14%. Though quite a bit lower than in other strategies I've presented in previous posts, the Max DD is only around -13%, which is one of the lowest I've seen in models backtested for this long a period.
This strategy is very easy to implement for free, perfect if you don't prefer to deal with Excel sheets I've provided for other strategies or don't have access to the TOS platform.
Clicking on this link takes you to the ETF Relative Strength Backtest section of ETFreplay.com,
where you plug in the info from the screenshot below: First ETF: "SPY", Second ETF: "TIP", Update Schedule: "Monthly". You can select the backtest to start in "2004" if you want to see in detail how the strategy has performed. ReturnA: "6-months" (Weight: 60%), ReturnB: "36-months" (Weight: 10%), Volatility: "20-days" (Weight: 30%). At the beginning of each month you come back and check what the new asset is, for November it is "SPY" (scroll down to the bottom of the page and you see the signal was issued on Oct 31, 2014).
Tuesday, November 11, 2014
Simple GMR Rotation Model
Jan 8, 2015 Update: I've also created an automatically updating Google spreadsheet, which uses adjusted close prices.
Here's another momentum rotation strategy I'm currently using that goes by the name "Simple GMR" (simple global market rotation). It is very similar to the "Global Market Rotation" model that I presented a few posts ago. Instead of the leveraged SSO (ProShares Ultra S&P500) this strategy uses the non-leveraged MDY (S&P MidCap 400); instead of FEZ (Euro Stoxx 50), IEV (iShares S&P Europe 350) and instead of EDV (Vanguard Extended Duration Treasury) a less volatile TLT (iShares 20+ Year Treasury Bond). The basket of ETFs therefore consists of: MDY, IEV, ILF, EPP, EEM and TLT. IJJ can also be used instead of MDY, but I like MDY because of the higher traded volume.
The advantage of this model is that the assets are old enough to be backtested to 2003.
Courtesy of Portfolio Visualizer, for the backtest period of 2003-2013 the CAGR (compound annual growth rate) is an excellent+ 30.95% and Max DD (maximum drawdown) -17.67%.
The mechanics are similar as with "Global Market Rotation" and "Global Transportation with Commodities". At the beginning of each month the strategy invests into an asset that has outperformed the other assets with a look-back period of 3 months. At the beginning of the next month, if the new leading asset is different from the previous month, the current held asset is sold and the entire allocation is invested into the new asset. No cash-stop is used with this strategy.
As with the other rotation strategies, I've attached an Excel Sheet and a TOS study to help with figuring out which asset to rotate into at the beginning of each month:
QH Simple GMR Spreadsheet
TrendXplorer
Varan (Seeking Alpha)
Here's another momentum rotation strategy I'm currently using that goes by the name "Simple GMR" (simple global market rotation). It is very similar to the "Global Market Rotation" model that I presented a few posts ago. Instead of the leveraged SSO (ProShares Ultra S&P500) this strategy uses the non-leveraged MDY (S&P MidCap 400); instead of FEZ (Euro Stoxx 50), IEV (iShares S&P Europe 350) and instead of EDV (Vanguard Extended Duration Treasury) a less volatile TLT (iShares 20+ Year Treasury Bond). The basket of ETFs therefore consists of: MDY, IEV, ILF, EPP, EEM and TLT. IJJ can also be used instead of MDY, but I like MDY because of the higher traded volume.
The advantage of this model is that the assets are old enough to be backtested to 2003.
Courtesy of Portfolio Visualizer, for the backtest period of 2003-2013 the CAGR (compound annual growth rate) is an excellent
The mechanics are similar as with "Global Market Rotation" and "Global Transportation with Commodities". At the beginning of each month the strategy invests into an asset that has outperformed the other assets with a look-back period of 3 months. At the beginning of the next month, if the new leading asset is different from the previous month, the current held asset is sold and the entire allocation is invested into the new asset. No cash-stop is used with this strategy.
As with the other rotation strategies, I've attached an Excel Sheet and a TOS study to help with figuring out which asset to rotate into at the beginning of each month:
Here are some links explaining more about similar models, including detailed backtests:
TrendXplorer
Varan (Seeking Alpha)
Monday, November 10, 2014
Hedged Convexity Capture
Leveraged funds and inverse funds inherently suffer from degradation, especially over a longer time-period. This happens because they're rebalanced daily, so although a leveraged 3x ETF might meet its goal of performing at 300% of its benchmark on each individual day, over time the fund's performance in relation to the benchmark or index will likely be significantly different due to the effects of compounding, and won't be able to maintain its 3:1 performance. This degradation is referred to as "negative convexity".
Here's a strategy that takes advantage of this inherent degradation of the assets. I don't in any way advocate it as a safe investment. It involves short-selling leveraged inverse ETP's (exchange traded products), and carries additional risks, such as the broker closing the position early and theoretically unlimited risk. Since the ETP's are young, this strategy also hasn't been tested during a true down-market, such as 2008. However, the backtested returns are pretty amazing (CAGR: +53.5%, Max DD: -22.40%) and I like the idea of the strategy attempting to gain on the "crappiness" of inherently "crappy" products.
I've personally been using this strategy for a few months with a small allocation, and so far it has been very successful. An additional cost for this strategy is the interest rate that the broker charges for borrowing the assets; at Interactive Brokers it's currently 3%-3.5% per year.
1. Short TZA (Direxion Daily Small Cap Bear 3x ETF), 50% allocation
2. Short TMV (Direction Daily 20+ Year Treasury Bear 3x ETF), 50% allocation
3. Rebalance weekly to maintain the 50%/50% dollar value weighting between the two instruments
To help with the weekly rebalancing, I've attached a Rebalancing Tool that will automatically calculate how much to buy or sell, using the "Rebalance by Desired Target Percentage" section.
Enter the current values in their respective columns and the "Reallocation Target %" to 50% and 50%. You'll get values under the "Funds to transfer" column and whether to buy or sell under the Direction column. You can also use this tool to help with rebalancing your portfolio in general.
QH Rebalancing Tool (Excel)
To read more about this strategy, please see:
http://seekingalpha.com/article/2110753-part-v-hedged-convexity-capture-continues-to-be-the-worlds-best-performing-etf-strategy
Here's a strategy that takes advantage of this inherent degradation of the assets. I don't in any way advocate it as a safe investment. It involves short-selling leveraged inverse ETP's (exchange traded products), and carries additional risks, such as the broker closing the position early and theoretically unlimited risk. Since the ETP's are young, this strategy also hasn't been tested during a true down-market, such as 2008. However, the backtested returns are pretty amazing (CAGR: +53.5%, Max DD: -22.40%) and I like the idea of the strategy attempting to gain on the "crappiness" of inherently "crappy" products.
I've personally been using this strategy for a few months with a small allocation, and so far it has been very successful. An additional cost for this strategy is the interest rate that the broker charges for borrowing the assets; at Interactive Brokers it's currently 3%-3.5% per year.
1. Short TZA (Direxion Daily Small Cap Bear 3x ETF), 50% allocation
2. Short TMV (Direction Daily 20+ Year Treasury Bear 3x ETF), 50% allocation
3. Rebalance weekly to maintain the 50%/50% dollar value weighting between the two instruments
To help with the weekly rebalancing, I've attached a Rebalancing Tool that will automatically calculate how much to buy or sell, using the "Rebalance by Desired Target Percentage" section.
Enter the current values in their respective columns and the "Reallocation Target %" to 50% and 50%. You'll get values under the "Funds to transfer" column and whether to buy or sell under the Direction column. You can also use this tool to help with rebalancing your portfolio in general.
QH Rebalancing Tool (Excel)
To read more about this strategy, please see:
http://seekingalpha.com/article/2110753-part-v-hedged-convexity-capture-continues-to-be-the-worlds-best-performing-etf-strategy
Subscribe to:
Posts (Atom)





























