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!

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).

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 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 
]

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 
]






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.

December 2014 Allocations




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.


.

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

Simple Pair Switching ThinkOrSwim Study

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.

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).


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

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

Monday, October 20, 2014

Buy-and-Hold/Dollar-Cost-Averaging Revisited

To take a break for a moment from rotation strategies, I wanted to introduce a strategy that I'm using for stocks that I'm looking to hold long-term. For me this includes blue chip dividend stocks that have been around for decades, have weathered through bad times and have a history of consistently increasing their dividend payout.

Timing the market is extremely hard. No one knows the future, so once invested, the only thing left to do is to adapt to changing conditions, whatever they may be. There are stocks that are on my "dividend champions" watch list, for example MSFT, that still haven't recovered to their all-time highs, even if the total market is making new highs.

Dollar-cost-averaging is a strategy advocated by many brokers and financial firms. It allows one to average out the cost-basis over time, without trying to time the market. This is great, assuming that a correcting asset will eventually rebound. It'll allow one to get back to break-even faster, since the cost-basis has been lowered from the initial purchase price. However if the asset just keeps on falling, one could keep on accumulating/compounding the losses, the whole concept approaching the principles of a martingale betting system.

So keeping in mind that if an asset is making new highs, we don't know if we're potentially buying at the top, and even if we buy on a dip we don't know if an asset will rebound or keep on falling, I created a "Buy-on-Dips" strategy, which allows one to gradually build up to a target allocation, without buying assets at the top, or without averaging down to zero.

The downsides of this strategy are that the target allocation isn't immediately reached, and that the asset could take a very long time (if ever) to recover accumulated losses.

Here's how the strategy works:

If an asset is -10% off its 52 week high, invest 10% of target amount of shares
If an asset is -25% off its 52 week high, invest 20% of target amount of shares
If an asset is -40% off its 52 week high, invest 30% of target amount of shares
If an asset is -55% off its 52 week high, invest 40% of target amount of shares
If an asset is -70% off its 52 week high, invest 50% of target amount of shares

I programmed the strategy to close the trade at a +20% profit, but one could modify this by for example taking half of the profits and trailing the rest with a stop etc. Or if fundamentally something with the company changes, where one no longer wanted to be invested, one could get out at break-even.

As a practical example, let's say that CVX (Chevron) is trading at $100 and the target amount of shares for CVX in a portfolio is 20 shares. If CVX corrects -10% from its 52 week high, one would buy 2 shares. If CVX corrects to -25% off its 52 week high, one would buy 4 shares. If CVX corrects to -40% off its 52 high, one would buy 6 shares.  If CVX corrects to -55% off its 52 high, one would buy 8 shares. If CVX corrects to -70% off its 52 high, one would buy 10 shares. After this, one wouldn't buy any more CVX, no matter the price action, until the target +20% return has been achieved (and the trade closed).

This results in the following transactions:
BUY 2 CVX @ $90 = $180
BUY 4 CVX @ $75 = $300
BUY 6 CVX @ $60 = $360
BUY 8 CVX @ $45 = $360
BUY 10 CVX @ $30 = $300

One would now hold 30 shares of CVX, with an average purchase price of $50 (totaling a $1500 investment ). To achieve a +20% return, CVX would have to climb back to $60.

The numbers I picked are somewhat arbitrary, one could probably try optimizing this strategy with TradeStation or AmiBroker, software which I don't have access to.

Here's a few screenshots of randomly picked stocks from my watchlist, showing when the strategy has bought and sold and the Profit&Loss curve below. As you can see in the first screenshot of MSFT, you would've had to wait 14 years from your initial purchase to get to a 20% profit, which is actually decent, considering MSFT still hasn't rebounded to the original purchase price levels. You could've gotten out at break-even though only about a year and a half after the initial purchase, despite the huge crash.




Below the same strategy applied to SPY, which showcases that maybe taking partial profits is better than the full 20%, because after taking profits in late 2011, there hasn't been any buy signals up to date.


Below is my current watch list of stocks, which also tells me if it's time to get in,
and with what allocation. At the bottom of this post, I've attached a link to the ThinkOrSwim BuyTheDips Strategies (5 of them in total, all to be applied in the "Edit Studies and Strategies" window). The same download link contains a text file that contains formulas for the watch list dividend yield and the indications of the current buy signals / allocations.

I've also attached a link to an automatically updating Google Drive Watchlist with the same info.





Links:

QH_BuyTheDips ThinkOrSwim Materials
QH Buy The Dips Google Drive Watchlist

Global Transportation with Commodities Rotation

Jan 8, 2015 Update: I've also created an automatically updating Google spreadsheet, which uses adjusted close prices.

Here's a variation of mine on the Global Market Rotation that I call "Global Transportation with Commodities Rotation" or "GTCR". I created this variation to diversify the Global Market Rotation with a somewhat different basket of funds (SSO, EEM and EDV are included in both strategies), including different asset classes that under certain economic conditions may be correlated in a different way. Commodities, for example, tend to bear a low to negative correlation to traditional asset classes, such as stocks and bonds.

GTCR uses SSO (ProShares Ultra S&P500), IYT (iShares Dow Jones Transportation Average), EEM (iShares MSCI Emerging Markets), DBC (ProShares DB Commodity Tracking ETF), AGG (iShares Barclays Aggregate Bond Fund) and EDV (Vanguard Extended Duration Treasury) as its basket of assets, and the model is based on the same calculations as the Global Market Rotation of the previous post.

At the bottom of this post are download links for the Excel file and ThinkOrSwim study that I use to show the rankings of the model.

My manual backtest of this strategy from May 2008 to May 2014 produces an annual return of +50% with a -23% drawdown, or expressed in another way, a total return of 1135%.





I also did a backtest on Portfolio Visualizer, switching EDV to TLT, which allowed me to backtest a similar strategy from 2006-2013. The CAGR was +36.66% and Max Drawdown -23.53%. It's worth noting that EDV and TLT, though both long-term bond funds, act a little differently from each other.
Also, this backtest doesn't include a cash-stop.




Links:

Global Market Rotation Model

Jan 8, 2015 Update: I've also created an automatically updating Google spreadsheet, which uses adjusted close prices.

Alright then, after the introductory post it's time to get to the meat of it all!

First up is a Global Market Rotation model, based on Marc Cohn's research, which is based on Frank Grossmann's research. If you want to read more about the models in detail, please follow the corresponding links on the right side of the page under "Sites I Follow".

The idea is to rotate between a basket of assets, switching allocations at the beginning of every month. The basket consists of 6 ETFs: SSO (ProShares Ultra S&P500), FEZ (SPDR Euro Stoxx 50), EEM (iShares MSCI Emerging Markets), ILF (iShares S&P Latin America 40), EPP (iShares MSCI Pacific excluding Japan), EDV (Vanguard Extended Duration Treasury).

At any given time, one is only invested in one of the aforementioned assets, based on whichever asset ranks highest at the end of each month. The previous asset is then sold and all the capital is re-allocated into the new asset.

The ranking is based on the logarithm of monthly performance over the last 3 months, and the asset rankings are compared to each other to determine the highest rank.

Also used is a cash stop filter, which determines the SSO/EDV correlation over the last 4 months. If the value is above 0.75 at the time of the switch, instead of investing into one of the assets, one would go to cash, or cash proxy SHY (iShares Barclays 1-3 Year Treasury). The idea of this is that in a global bear market, one would be invested in long-term bonds (EDV), except when the bonds are too closely correlated with the market.

It is worth noting that this strategy uses a leveraged asset SSO. Frank Grossmann suggested that the rotation strategies work better with a basket of assets that are similar to each other in their volatility, and SSO is more in line with the volatilities of the other assets in the basket than SPY.

I've created an Excel-sheet (the download link is at the bottom of the page) that I use to determine the rankings of the strategy. The data used are adjusted monthly close prices from "Yahoo Finance". My current version of the Excel sheet can automatically pull current price data from Yahoo; to do this, you'll need to go to the "Parameters" tab and click on "Get Data from Yahoo Finance".

Having created it, I'll be the first admit that the Excel-sheet isn't quite as smart as it could be.
After the allocation switch is done, I manually enter the final adjusted monthly close prices (instead of the function that refers to the current prices fetched on the "Parameters" tab). I also have to manually input the data from the previous month to the next month's table. If anyone wants to take a stab at making this more user-intuitive, go for it and please post a link to your creation!

As you can see in the screenshot below, at the moment I captured this shot, it looked
like EDV will be the clear contender for November. Of course there's still time for this to change,
since the ranks only matter at the end of the month, at the time of the switch.

The "St. Dev." column isn't used in this particular strategy.





Also included in the Excel sheet is my manual backtest from May 2008-May 2014, resulting in a +51% annual gain with -16% drawdown, or expressed in another way, a total return of 1203%.
I've also added in the months after May. As you can see, it's not all smooth sailing - the strategy also goes through troughs; the model is currently experiencing a -14% drawdown.



If you have access to ThinkOrSwim, I've also created a study that shows the current rankings of the different assets, the asset in green being the current top contender for the next month. Just add this study to any chart. The MC GMR refers to "Marc Cohn Global Market Rotation".




Please let me know if you notice any errors in any of the data, and feel free to leave comments below!

Links:
QH MC GMR Excel file
QH MC GMR ThinkOrSwim study
QH GMR Spreadsheet

Friday, October 17, 2014

And So The Journey Begins

I've been investing and casually trading for about 5 years now, always looking for a better, more profitable way to acquire wealth, with minimizing the risk as much as possible.

What worries me is what's been happening with the stock market ever since around the change of the millennium. As you can see from the picture below, for about 25 years before that buy-and-hold investing was relatively easy. However, had you bought in 2000 or 2008, you might have seen your portfolio decline over 55% in value. I don't know if I could personally stomach that kind of a move.

In a larger context, looking at the Dow Jones for about 100 years back, we also see that choppiness is pretty normal; meaning, if you're unlucky with the timing, you could potentially spend decades before seeing your account balance at break-even.


A traditional strategic allocation is usually based on holding a basket of diversified assets.
One of the best results for the last 12 years is if one had held SPY (S&P 500 ETF Trust) and TLT (iShares Barclays 20+ Yr Treas.Bond) in a 50%/50% allocation, rebalancing annually. As you can see from the screenshot below (backtested on etfreplay.com) the CAGR (compound annual growth rate) would've been +9.6% vs. just holding SPY +9.0% and the Max Drawdown -20.55% vs. just holding SPY -55.20%.



Since ETFs have a limited history, a similar backtest on portfoliovisualizer.com with correlated mutual funds FDVLX (Fidelity Value Fund) and VUSTX (Vanguard Long-Term Treasury Fund) allows us to go back to 1987. This showcases similar results, with the CAGR at +10.19% vs. just holding FDVLX +11.19% and Max Drawdown -27.44% vs. just holding FDVLX -62.24%.

Ok, so this is already much better than just holding the market, or counting on good luck with stock picking skills, or good timing with buying when the market is bottoming out and avoiding buying at market tops. However, I wonder if there was a way to (statistically speaking) increase returns without increasing the risk (Max DD) or even lowering it?

About 6 months ago I came across terminology new to me, which includes tactical asset allocation (TAA), flexible asset allocation (FAA), adaptive asset allocation (AAA) and rotation model strategies. Models based on these concepts generally require a somewhat more active investing approach vs. the traditional buy-and-hold strategic allocation method.

In the upcoming posts I'm going to showcase some of the (in my opinion) better models I've come across and open them up for discussion. Of course no backtest is going to guarantee future results, but the study of statistics is the study of probability.

As my first handout, for anyone who has access to the ThinkOrSwim (TOS) platform, here's an indicator I'm currently using that would've kept one out of the 2008 tumble, yet kept one in the market from May 2009 up to date: QH_AdvDecnCumulativeStudySTUDY

More TOS studies/strategies and Excel sheets to follow in subsequent posts.
If you're interested in learning more, please check out the "Sites I Follow" links on the right side of the page. These sites offer a wealth of information, and are the source of most of my knowledge and model strategies.