Correlation with Bond Yields

Hat tip to Gökhan Kula for sending this along.  For the few years I have been trading, bond yields have been strongly correlated with stocks.  Stocks go up when bonds go down, so much so that I regard SPY and TBT as the same play.

I have the following chart in my collection on stockcharts.com, just in case the correlation should someday break.  That seems to be happening now, with post-QE yields headed toward 3%.

TNX CorrelationMy chart, below, recapitulates the analysis of J. P. Morgan.  It shows the rolling two year correlation of weekly S&P 500 returns with weekly changes in the 10 year Treasury yield, plotted against the  Treasury yield.

SPX TNX CorrelationThis is the correlation of correlation, so to speak, with bond yields.  You can see that the strong correlation, to which I am accustomed, becomes weaker and then negative as yield rises through 5%.  Of the 2,700 or so datapoints, only 415 have TNX < 4.0, so this low yield is an historical anomaly.  Here is the timeline (note the log scale).

TNX LifeSince 2008, the correlation has seldom been below 0.4, and often as high as 0.7.  Here’s what that has looked like in terms of weekly returns.

Scatter3For comparison, here is that ancient period when stocks and yields were negatively correlated – or, to put it another way, stocks and bonds rose and fell together.  Don’t ask me what asset class funds flowed to when both were down.  Cash or real estate, I suppose.

History

Posted in Economics | Tagged , , | Leave a comment

Portfolio Balancing Models

Part one in a series

When you read about portfolio management, the emphasis is typically on selecting issues for diversification – an inflation hedge, real estate, bonds, etc.  The allocation of capital within the portfolio is then revised periodically (rebalanced) based on some rules.  Nowadays, you can do this entirely with ETFs.

In this post, I will present some alternative balancing models, with different risk return characteristics.  Requirements for each model are:

  • Mechanical rules suitable for a nonprofessional (or a robot)
  • Balance once each month, to reduce commissions
  • Rule for going to cash

The choice of ETFs is secondary.  The main thing is that they be diverse.  That is, weakly (or negatively) correlated with each other.  I’ll come back to that in a later post.  For now, I present this portfolio without comment:

  1. SPY – SPDR S&P 500 ETF Trust
  2. EFA – iShares MSCI EAFE Index Fund
  3. IEF – iShares Barclays 7-10 Year Treasury Bond Fund
  4. TIP – iShares Barclays TIPS Bond Fund
  5. EEM – iShares MSCI Emerging Markets Index
  6. IWM – iShares Russell 2000 Index
  7. XLB – Materials Select Sector SPDR
  8. IYR – iShares Dow Jones US Real Estate
  9. TLT – iShares Barclays 20+ Yr Treasury Bond

The chart below shows their performance over the ten year period.  It’s hard to look at, but you can see the 2008 crisis and the jump in bond prices.

Chart0This is end of month data, and the period is January 2004 through January 2014.  We are going to write our rebalancing rules based on the month end figures, and assume we can buy at roughly that price to start the new month.  We are also going to assume a smooth allocation to the ETFs, disregarding lot sizes.

The chart below shows the performance of a balanced portfolio versus SPY.  We start with $1,000 in each of the nine ETFs, plus $1,000 cash.  Each month, we rebalance the total, one tenth into each category.  I call this the “equal allocation” model.  It is probably the most natural, intuitive way to do it.

Model1This model performs slightly better than SPY, returning 68% over the period versus 58%, and with less risk.  The standard deviation of monthly returns to the model is 3.2% versus 4.2% for SPY alone.  It does not perform as well as some of the other issues, in absolute or risk adjusted terms.  Since TIP is handy in the portfolio, we’ll use it to compute Sharpe ratios for whole group:

Table1The ETFs to beat are EEM and IWM, for absolute and risk adjusted returns, respectively.

Perhaps you have noticed a flaw in the logic of this model.  As Loeb says in his book, it has the effect of moving capital from issues that are performing well, and “spreading the wealth” to those that are not.  For the next model, we rebalance pro-rata according to how well each fund has done over the last month.  Here’s how that performs:

Model2In the first month we start with equal allocations, and we make a 2.3% return (actually, a little less because we start with $1,000 allocated to cash).

Table2For the next month, we allocate according to how each fund performed as a percentage of the total.  This “total” figure only serves to make the pro-rata calculation.  Here is the result:

Table3In this month, XLB did best, so it gets the most capital going into the next month.  This approach kind of assumes that last month is a predictor of next month’s performance, but not really.  That’s a proven fallacy.  What the model assumes, after Levy, is that last month’s relative rankings within the group are predictive.

I call this the “winners only” model, because it allocates only to those issues making gains.  Its average monthly return of 1.1% dominates EEM, and its variability is less than SPY.

Results for this model are impressive, but it has some drawbacks.  In some months all issues lose money, leaving no choice but to reuse the prior month’s rankings.  It also cannot go to cash.  Finally, the model produces a very erratic mix of issues from month to month.  The chart below shows the portfolio mix for a representative year:

Histo2This is the killer.  No one would think of running a retirement portfolio like this.  For the next model, we keep the pro-rata concept, but we resolve to stay in nine of the ten issues (counting cash) every month.  We do this by baselining all issues relative to the month’s worst performer.  For example, in a month where the returns are:

Table4We find the biggest loser, 2.6%, and add that amount to each return:

Table5Then, we repeat the pro-rata allocation as before.  Note that cash, which always returns zero, receives an allocation when any other issue makes a loss.  I call this the “drop one loser” model.  In this example, XLB is the biggest loser, and so the portfolio will hold no shares of XLB in the next month.  If all issues make gains, then cash is weakest, and the model goes fully into ETFs.

Model3This one is not as chaotic as model #2, but it also doesn’t perform as well.  Its monthly average return of 0.7% is weaker than IWM.  I’ll give a thorough comparison at the end.

Finally, I find a middle ground between models #2 and 3, by baselining to the second weakest performer.  Thus, the month shown above would be baselined to -1.7%, dropping SPY as well as XLB.

Table6The resulting allocation is:

Table7I call this the “drop two weakest” model.  I could go on with dropping three, etc.  This one has, to my eye, the right amount of churn from month to month.  Here is 2005 again.  If you compare it with the histogram above, you can see the resemblance (the colors are the same).  Model #4 tends toward the same issues as #2, but it doesn’t go all in.

Histo4The chart below shows all four models on the same chart.  Model #2 is the overall best performer.  Its superior return and low drawdown compensate for its higher variability.  If this were my IRA, though, I would go with the less erratic model #4.

Model4Safe, timid, model #1 has the worst drawdown of the bunch.  It continued shoveling money into stocks during 2008.  That’s why “equal balance” models need explicit warning signals to move out of stocks.  The other three models have implicit warning signals that move them seamlessly into cash and bonds.   Here is the drawdown chart:

DrawdownThe table below summarizes results for the four models.  I like to see the returns and variability on a monthly basis, instead of discounting the total return.  I think that’s more appropriate for this application.  Apart from that, my Sharpe ratio is conventional, using TIP as the risk free return.

Table8As long as you have negatively correlated issues to work with, you can achieve your desired risk return tradeoff by tweaking the model.  It’s kind of like the CAPM of portfolio balancing.  I will cover the selection of ETFs in a later post.

Posted in Strategies | Tagged , , , , , | Leave a comment

Short SPX for 2014

The purpose of this post is to explain why and how I shorted the S&P 500 on Jan. 6.  In an earlier post, I described the two methods I use for detecting “tops” or, more precisely, local maxima.  I also said that I don’t trade this signal.  In fact, since I use a countertrend strategy, I will be taking long swing trades all the way down.

The chart below shows SPX going trendless in early December.  You see ADX(14) < 20 and you also see SMA(10) go flat.  There’s a crazy ramp at year-end, and then SMA(10) resumes flat.  I reasoned that many investors were holding off selling until the new tax year, so I ignored the ramp.  This theory is supported by the low volume.

TrendlessThe other method is to count distribution days.  I posted this next chart on stocktwits, last Thursday.  By that time, I was very surprised the IBD hadn’t registered “under pressure.”  The chart shows daily volume, and it also shows Chaikin’s money flow, a handy way of evaluating up and down volume.

NYSEPeter Brandt said it best.  Chart reading doesn’t enable you to predict the future.  It enables you to take trades with favorable risk reward.  In this case, I could set my stop 1% away at “new all time high,” against the possibility of a prolonged decline.

The other issues I might have chosen to short, QQQ and IWM, were already more than 1% off their peaks.  The Russell had peaked earlier (another tell) on Boxing Day.  Speaking of Canadian holidays, last week I posted my approach to currency hedging.  Instead of selling SPY short, I bought SH, the 1x inverse ETF.  The market usually moves opposite to the USD, so my negative USD position is a hedge.

I might also have bought SDS, the 2x leveraged ETF, but then my stop would be 2% away.  It’s confusing enough having to remember that my mental stop to cover SPY at 184.69 is really to sell SH at 25.22. Happy new year!

Posted in Indicators | Tagged , , | Leave a comment

Robots Strike Again

I posted about this a few weeks ago, and now Twitter has supplied another example:

RobotsThis trader would still be in a not bad position but, once his stop was triggered, he got hosed for a $2.41 loss.  Nothing is more frustrating.  If you can’t be at your screen, then you may have to use a hard stop.  Otherwise, keep it close to your vest.

Here is Hunsader’s wonderful close up of gold futures plunging $30 (instantly) on heavy volume, and triggering a ten second halt.

Nanex_GCThe halt gave alert traders the opportunity to get back in, for futures.  Stock traders were not so lucky.

Posted in Trading | Tagged , | Leave a comment

For Canadians Only

In addition to system trading, I like to keep part of my capital in a “macro” trade.  This is some perversity of having read too much economics at business school.  Last summer, I went short U.S. bonds.  This returned 5% over three months.  I might have kept it on.  TBT is up another 7% since.

If your base currency is not USD, then your macro trades are also currency bets.  For example, I chose to short U.S. bonds by buying TBT instead of shorting TLT.  This means that my long TBT position was offset by a USD denominated debt.  I reasoned that if the Fed chose to buy down U.S. bond yields, they would cheapen the USD.  So, my trade implicitly included a currency hedge.

If I had instead shorted TLT, then I would be sitting on a lot of USD.  I would be betting on bonds to go down but not USD, an unlikely combination.

When you trade U.S. markets with a CAD account, IB automatically loans you USD.  My CAD capital is basically collateral for a USD trading business.  I withdraw profits in CAD, to pay the bills, and every so often (when USDCAD is rich) I explicitly convert the accrued USD balance.

CHFThis is not really for Canadians only.  Wherever you are, your choice of base currency is arbitrary.  What really matters is the currency in which your expenses (and taxes) are denominated.  Still, you can’t go wrong with Swiss Francs.

Posted in Economics | Tagged , , | Leave a comment

Thoughts on Correlation

Mean reversion is aided by volatility, and momentum trading is aided by relative strength.  I have been exploring the distribution of relative strength.  Market strength and breadth are handily characterized by the mean and standard deviation of this distribution.  It is almost a measure of market correlation, but not quite.  I am tempted to call it “collimation,” because it measures how tightly the body of stocks hew to their long term trends.

I can find only one published measurement of market correlation.  The CBOE computes implied correlation, based on option prices for fifty stocks.  See the CBOE website.  Below is a chart showing correlation, along with VIX and the SPX.

CBOE CorrelationThe CBOE data is hard to work with, because each of the series is based on options expiring in January of a different year.  For example, the nearest dated series just became KCJ, which is based on options expiring January 2015.  I produced a long series for this chart by splitting each year at July 1.  So, instead of 2-14 months, the concatenated series uses options expiring in 6-18 months.  This avoids the jolt of switching series at yearend.

There are times when index option implied volatility moves and there is no corresponding shift in implied volatilities of options on those components. This outcome is due to the market’s changing views on correlation.

It would be nice to measure historical correlation among stocks, directly, so I charted the average 20 day pairwise correlation among the nine sector ETFs.  I think this is a pretty good indicator, but it doesn’t predict JCJ.  Instead of the 36 pairs, you can simply compare each ETF to SPY.  The results are about the same.

CorrelETFSome people like to combine correlation and volatility into a single ratio, JCJ/VIX.  What does this number mean?  I’ll come back to that, but first let’s consider how we might use correlation and volatility to characterize market conditions:

Low correlation and volatility – This is an emerging bull market, which rewards good stock selection.  If it persists, though, the herd will follow and correlation will increase.

Low volatility, and correlated – This is a mature bull market, in which all stocks are rising together.  You might as well just buy the index.

Uncorrelated, and volatile – Simmering volatility with low correlation means that diversification is protecting the VIX but weak stocks are suffering.

High correlation and volatility – Elevated VIX means the market is in trouble, and all stocks are going down.  In a crisis, as Dr. Bandy says, all correlations go to 100% (or at least 80%)

I find it best to look at JCJ (or KCJ) and VIX independently.  So, why do people use the ratio?  Here’s the best explanation I can think of.  Start with the formula for index volatility:

Fig1Recognizing that ρ = 1 where i = j, we can write a more compact formula:

Fig2You can see how VIX is affected by the pairwise correlation term. The formula for average correlation is:

Fig3Since:

Fig4Then:

Fig5This makes intuitive sense.  It’s the sum of the weighted variance terms with pairwise correlations, divided by the same sum without them.  In fact, it’s a lot like:

Fig6This is different from JCJ because it includes the same-stock (i = j) cases.  Still, since:

Fig7You could make a case for VIX2/JCJ as a gauge of total volatility “under the surface.”  I am not a fan of this, although it would be interesting if the CBOE were to publish an absolute volatility index without the diversification effect.

I can think of one other reason to look at JCJ/VIX.  Since SPX is negatively correlated with VIX (over short timeframes) you might want to chart SPX versus 1/VIX to show a divergence.  I do this on a daily chart with one minute bars.

VIXIn this case, using JCJ/VIX might be useful, but you still have to run a second chart to see which one is causing the divergence.  The short answer is, look at volatility and look at correlation, but don’t combine them.

Posted in Indicators | Tagged , , | Leave a comment

Long Term Chart Analogues

I saw this chart again on Stock Twits, an old favorite.  It’s due to fellow Canadian Dr. Jean-Paul Rodrigue.  The ramp, the “mania phase,” and the double top reminded me of the NASDAQ bubble I posted earlier.

BubbleChartA freehand chart like this is a good way to illustrate market psychology without being tied down by actual cases.  I did the same thing when I presented the H&S pattern way back at the beginning of this blog.

I like the way Rodrigue’s chart shows an accumulation phase, then public attention, and finally reversion to the mean.  Here is Dr. Flumiani’s chart, after Livermore:

LivermoreLivermore applied this model to speculation in individual stocks, not (necessarily) the general market.  We call his cylinder a “coil” today, both terms attributing a third dimension to the chart.  Legend has it that Livermore went short at the top in 1929.

Both models are well supported by the dotcom crash, below.

DotComBubbleHere we see a clear accumulation phase, just like Livermore’s cylinder, then consolidation below 2900.  The gap up through 2900 and then the round number 3000 brought in the public, and set off the “mania” phase.  All three charts have that second peak which is the final clue before the crash.

This is not a pattern I actually trade.  Marcel Link, in his book, discusses the psychology of trying to catch singular events.  I just put up the charts because they’re interesting.  Tom McClellan has found a number of long term pattern analogues, like this one:

HysteriaThe first time I saw this chart, I thought it was nonsense.  You can always line up today’s bull market with another bull market from the past, but Tom makes a pretty good case.  I still don’t think it’s a guide for timing, though.  If you want to do that, I recommend the O’Neil method or the ADX method I posted before.

Posted in Patterns | Tagged , , | Leave a comment

Levy Ratio Dispersion

I have been experimenting with Levy ratio dispersion as a measure of market breadth.  Saturday, I posted this chart on Stock Twits, showing lower lows, lower highs, and declining RSI for $OEXA200R.

12-7-2013 8-30-09 AMThe chart shows that 87 of the S&P 100 are trading above their respective SMA(200) lines, but it doesn’t tell us by how much.  Some could be teetering on the line, and some could be soaring above it.  Here is a chart of six stocks, relative to each one’s long term trend.  Following Levy, I use SMA(131) but I divide it into SMA(10) to smooth the series.

SixThis “smoothed Levy ratio” is a measure of momentum, like MACD.  The chart shows it increasing for AK Steel, and decreasing for Sony.  Pepsi, as you can imagine, never strays far from its long term trend.  Below is Lincoln Electric, still in an uptrend but losing momentum.  Note the concurrence of the MACD indicator.

LECOFor an individual stock, there are several indicators of momentum, but the Levy ratio gives us a way to compare groups of stocks.  Below is the distribution of Levy ratios in the S&P 500.  For consistency, I am using the same 500 as I did in October, with the same scale.

Levy HistoNow, instead of saying that 87% are trading above their SMA(200), I can say that the mean Levy ratio is 1.05 with a standard deviation of 0.08.  This is a stronger and tighter distribution than the one I posted in October.  I can even test the hypothesis that the group’s aggregate momentum is flat, which it obviously is not (with 74% confidence).

Levy showed that a stock’s relative rank over the last 26 weeks was a good predictor of its rank 26 weeks later.  This is the basis of momentum trading.  He also analyzed what he called “divergence” from the mean, finding that greater divergence was generally bearish.

Posted in Indicators | Tagged , , , | Leave a comment

Understanding House Prices

It’s hard to know if the housing situation is really improving.  Prices go up, but then units go down.  Classically, you can think of the equilibrium price vacillating around $200K, while the supply and demand curves do their dance.  Here is the raw data, from the National Association of Realtors.

Home SalesYou can see that prices have fallen since June, but units are still looking good (units are seasonally adjusted).  An obvious way to combine the series is simply to multiply them, and arrive at total sales in dollars.  Here, we want to use the mean price, not the median.  The realtors’ data includes unadjusted sales per month, but I think it’s best to use SAAR.

Home Sales2I was also curious to see what factors they use for seasonal adjustment,  Here they are:FactorsThese neat time series, though, obscure what’s happening with supply and demand.  That is, increasing demand with a static supply curve will clear more units at higher prices.  Increasing supply with a static demand curve will clear more units at lower prices.  Of course, neither curve is static.  That’s what I meant by “dance,” above.  The locus of the clearing price over time looks like this:

SwirlWe also have supply data, as units of inventory.  See how it tracks total dollar sales in that second chart.  Since inventory is inventory in the current month, I backed out the seasonal adjustments for this last chart, relating inventory to total sales.

ScatterThe regression plot shows that supply and demand are working as expected, and the swirl chart tells the story.  I have price on the vertical axis, so you can easily picture how the interaction of those two curves produced this locus.  If you have trouble with that, here is my favorite basic economics visual aid.Etch-a-sketch_inner

Posted in Economics | Tagged , , , , | Leave a comment

Thoughts About Volatility

Back in September, I was testing the Connors RSI pullback strategy, and I posted an observation that the strategy performs best in a volatile market.  Volatility gives you the setups, and mean reversion gives you the profits.  If the market is in a steady uptrend, you’re better off with a momentum strategy.

The volatility measure I used in that post was STDEV(40).  This was a good predictor of when Connors is profitable, but it’s not a scaled measurement, so I coded up my own HV(40) indicator.  Below is a current chart of various volatility measures.  For comparison, all the periods are 20 days.

VolatilityThe main chart is SPX, where the width of the Bollinger band is a good measure of volatility.  The bottom chart is also based on standard deviation, but it is 1X STDEV scaled to a percentage.  Bollinger bands are typically 2X and not scaled.  That’s good for trading, but not so good for research.  I also annualized the indicator, to give comparable units.

This brings us to the middle chart, which has VIX and HV(20) + 4.  Why the plus 4?  I wanted to show both series with the same scale, and still have them line up.  You can see that HV tracks VIX pretty well in the flats and on inclines, as option prices rise in response to daily price swings, but not so well on declines.

Remember that VIX is supposed to be predicting the variability of SPX going forward.  If option traders are pricing risk correctly, you would expect to see VIX leading HV, especially given the 20 day lookback.  You would at least expect to see VIX track even with HV, and in both directions.  Here, it appears that traders tend to underestimate volatility when prices are rising.

At the June low, for example, VIX has spiked and then declines over the next month as prices rise.  But HV remains elevated and the Bollinger bands widen over this period.  You can see the same thing at the April low.  A likely cause of this anomaly would be the prices of protective puts, spiking and then quickly subsiding as the uptrend resumes.

Volatility2The chart above provides some circumstantial evidence for this idea.  The bottom panel is the two-day moving average of daily percentage loss.  That’s loss only, MAX(-∆P%, 0), not absolute change or signed change.  This suggests that VIX is, as they say, a “fear index.”

CometNext, I regressed VIX on HV(20).  You have probably seen this chart before, but I am not so sure VIX is the dependent variable.  Traders undoubtedly consider HV when pricing options, and then VIX is derived from option prices.  So, it’s a tautology.  That’s why the RSQR is 82.

Posted in Indicators | Tagged , , , | Leave a comment