Showing posts with label Trading. Show all posts
Showing posts with label Trading. Show all posts

Sunday, October 30, 2016

The subject of portfolio allocation and diversification has come up quite a bit in various fora that I frequent.  I’ve occasionally answered such questions in some depth, but usually I’m pressed for time and give an admittedly half-assed answer along the lines of, “You’re not nearly as diversified as you think you are.” I’ve seen this pop up in various forms from the individual investor: “I own some tech stocks, banking stocks, some natural resource stuff and even some utilities.  I’m diversified!  Why did I lose so much when the market dropped?”  Financial advisors tend to recommend this kind of portfolio structure, and the trend in the last few years has been to try to automate the process with the rise of so-called robo-advisors.  For whatever reason, it has never occurred to people that the underlying assumptions are incorrect, and simply automating flawed logic will not produce better results.

Because time is limited today, i’m just going to focus on correlation and why these types of portfolios are not as diverse as people think.  Liquidity, strategy, and product availability are also huge issues, as is the total lack of basis improvement, but those will have to wait for another day.  Liquidity is king, but all I’m going to say about it today is that on Friday, 10/28/2016 SPY (the S&P 500 ETF) traded 140,623,18 shares while VTI, one of the suggested underlyings of a model portfolio below only traded 2,868,068.  Which would you rather be involved in?  Also, there is not a liquid derivatives market around VTI while SPY options have penny-wide markets.  The last thing I will say here is there is no way to get short.  Everything is long and the closest thing to a short here is bond positions which tend to move opposite the stock market.

So let’s start looking at some of these portfolios.  Here is a list of the components of a sample portfolio listed on one particular provider’s website.


Vanguard U.S. Total Stock Market Index ETF (VTI)
Vanguard U.S. Large-Cap Value Index ETF (VTV)
Vanguard U.S. Mid-Cap Value Index ETF (VOE)
Vanguard U.S. Small-Cap Value Index ETF (VBR)
Vanguard FTSE Developed Market Index Index ETF (VEA)
Vanguard FTSE Emerging Market Index ETF (VWO)
Vanguard Emerging Markets Government Bond Index ETF (VWOB)

iShares Short-Term Treasury Bond Index ETF (SHV)
Vanguard Short-Term Inflation Protected Bonds ETF (VTIP)
Vanguard U.S. Total Bond Market Index ETF (BND)
iShares National AMT-Free Muni Bond Index ETF (MUB)
iShares Corporate Bond Index ETF (LQD)
Vanguard Total International Bond Index ETF (BNDX)

For the sake of liquidity, let's substitute these with products that are much more widely trade and have a liquid derivatives market around them as well. We'll make the following substitutions:

VTI -> SPY (S&P 500 ETF)
VTV -> DIA (Dow Jones Industrial Average ETF)
VBR -> IWM (Russell 2000 small cap ETF)
VWO -> EEM (Emerging markets ETF)

The problem with bond-related products is again a lack of liquidity.  Sticking with ETFs, the only products that have both liquid stock and option markets are TLT and TBT, so let’s make one more substitution:

BND -> TLT (20+ Year Treasury bond ETF)

The plot below shows the price action of SPY, DIA, IWM, and EEM.  I’ve taken the liberty of multiplying EEM by two just to put it on the same scale as the others, as it is a lower priced product, and I don't want to mess up the scale of the chart.  Just eyeballing the plot, how diversified do you think you are?  Remember, the goal is to protect yourself should the market move against you, but these look like they move tick-for-tick with each other.  And EEM is emerging markets with holdings in India, Russia, South Africa, Brazil and others.  Should be different than the US stock market, right?  Well again, look at the plot.  It is basically the same as the S&P 500.

Price action of SPY, DIA, EEM, and TLT for the last five years
Let’s get a little more mathematical and start looking at beta and correlation coefficients.  Beta assumes a linear model between the percent change in two underlyings and gives the slope of that linear relationship.  It can be easily calculated by taking the daily percent change in two underlyings and doing a linear regression.  Beta will tell you how much you’d expect one stock to move given a movement in the market.  For example, with a beta of 1.0, we’d expect our underlying to move one percent if the market rises one percent.  With a beta of -0.5, we’d expect a half percent drop given a one percent rise in the market.  Beta, however, presupposes a linear relationship which may or may not exist.  We also need to look at the correlation coefficient which measures the degree to which that linear relation holds.  A correlation of 1.0 means they are perfectly correlated -- if one goes up, the other goes up.  Similarly, with a correlation of -1.0, if one goes up, the other will go down.  A hand-waving way to think about this is that the correlation tells you how likely two underlyings are to move in the same direction.  I’ve tabulated the values of beta and the correlation coefficient for the four underlyings we are looking at below. These are calculated in the same time frame as the plots above, the last five years of data.

Beta Correlation
DIA 0.92 0.97
IWMl 1.14 0.89
EEM 1.20 0.80
TLT -0.47 -0.46


We can also visualize the relationships by plotting the percent change of each underlying and drawing the regression line through the data.  I have done so below for DIA, EEM, and TLT.

Scatter plot of the daily percent changes in the SPY and DIA (grey) with a regression line drawn through the data (black)

Scatter plot of the daily percent change in SPY and EEM (grey) with a regression line drawn through the data (black)

Scatter plot of the daily percent change in SPY and TLT (grey) with a regression line drawn through the data (black)
Clearly, the Dow is almost perfectly correlated to the S&P 500 with a coefficient of 0.97. That's shouldn't be horribly surprising as the mega-cap stocks making up the Dow are a big part of the S&P. But even the foreign stock markets represented in EEM have an extremely strong correlation to the US market. Therefore, you can hardly say you've diversified your portfolio and have gained some protection from a market selloff by buying EEM on top of SPY. They are the same position for the most part.

The only thing in this list significantly different from the behavior of SPY is TLT, the 20+ year bond ETF. As we'd expect, this has an inverse relation to the stock market with a reasonably strong negative correlation of -0.46, so long bonds can partially offset a long stock portfolio. That's not necessarily a bad thing as we'd want something different as a means of diversification. This assumes that the relation would continue to hold with interest rates at zero. Bond prices move up as interest rates move down. How much lower than zero can they go, and how long can they stay there?

So how diversified is the portfolio suggested? Not very. Despite all the products they recommend, you are long the S&P and long bonds with the bond position providing only a slight offset for stocks.


Sunday, July 10, 2016

Some observations on the stock and bond market

In my professional life I do a lot of mathematical modeling of physical systems.  My background is in experimental physics, but after I finished my postdoctoral work, I switched to doing mostly computational work.  I am also an active trader in the financial markets making roughly 1000 trades per year.  Since I already have the computational tools at my disposal, I will occasionally sit down and crunch some trading-related numbers.  It's an engagement tool, mostly.  It is not as if there is a magic formula waiting to be discovered-- if such a thing existed, given the amount of money and resources chasing returns, it would have been found long ago.  But it keeps me thinking about things, keeps me sharp, and sometimes it is nice to look over some numbers to either confirm our disprove suspicions.


Anyone who follows the market likely know that stocks and bonds typically have an inverse relation-- if the stock market rallies, the bond market tends to sell off and vice versa.  This relationship isn't absolute, but it does tend to be true the bulk of the time.  So with the stock market within spitting distance of record highs, we’d expect the bonds to be trending lower.  But this isn't the case.  In fact, bonds are also at record highs.

I sat down this weekend to look at the recent correlations between bonds and the S&P 500 index to see what level they've been at in the last few years, and how much they've changed in recent weeks. What follows is more or less a quick "stream-of-consciousness" analysis I did. At the risk of belittling myself, it isn't the most insightful of things-- the market has been weird, we all know that-- but it was interesting enough I thought I'd write it up and post it.

For the sake of simplicity and ease of access to data, I used the ETFs SPY and TLT for the S&P 500 and the classic bond, respectively.  SPY tracks the S&P 500 and while TLT tracks the 20-year bond in is close enough to the classic bond.  They are close enough in maturity as to move tick for tick with each other.  I've plotted the last five years of price data for both ETFs below.

Prices of SPY (red) and TLT (blue) for the last five years.  Both are at or near record highs

Interesting.  Just looking at the raw price data, there seems to still be somewhat of a negative correlation, but it isn't easy to discern.  In any case, I look at correlation of returns, not raw prices.  I worked out the daily percent changes and calculated the correlations over the entire data set, the last calendar year, and the last 30 calendar days:

Entire data set: -0.54
Last calendar year: -0.51
Last Calendar month: -0.67

That surprised me.  I expected the correlation to become more positive over the last month as we've had a huge rally off the Brexit S&P low and a run up in bond prices.  This doesn't seem to be the case.  What seems to have happened is any selloff in the market in the last month is met with furious bond buying, and market rallies are met with tepid if any bond selling.  Add to that the occasional day where you have both the market and bonds up and here we are...

Next I was interested in how the correlation changed over time.  Was it relatively constant? Obviously, it varies, but to what extent?

Rolling correlation between TLT and SPY with a 20-trading day window
I calculated a rolling correlation on the data set using a 20-day window.  This is plotted above.  These are trading days, not calendar days as it was easier to calculate.  That time window works out to close to a calendar month.  Indeed, there have been times where the correlation changed drastically for brief periods of time, even becoming positive on a number of occasions.  These times of positive correlation didn't last long, however, and we are currently running about normal.  That wasn't what I was expecting.

I started plotting different date ranges and ended up plotting daily returns for both underlyings on the same plot.  Bonds are a debt instrument and are generally considered more placid than the stock market.  But looking at the returns from 20011 to present, the daily percent price fluctuations for SPY and TLT were a lot closer than I would  have thought.  Doing the same plot over the dates 2003 to 2008 (I wanted to visualize this without the craziness of the meltdown later in 2008) showed that, yes, indeed the realized volatility in the bonds was significantly less than in the S&Ps.  Instead of showing the plots which are a mess to look at, here is the standard deviation of returns for those two different time windows.

Standard deviation of returns from 07/08/2011 - 07/08/2016
SPY:  0.0099
TLT:  0.0095

Standard deviation of returns from 01/01/2003 - 01/01/2008
SPY:  0.0082
TLT:  0.0063

Interesting.  For all practical purposes, during the lat few years realized bond volatility has been the same as realized stock volatility.  We can visualize this by calculating a rolling standard deviation over thse data ranges and plotting the results.

Rolling standard deviation of daily returns for SPY and TLT using a 20-period window

Above is the this plot from 2001 to present.  There are periods where the bonds are comparatively sedate, but there are also times where they move as much as the general market.  Let's look at the same type of plot from 2003 to 2008.  Here we can see the data for the bonds is generally below that of the SPY, especially during times where SPY volatility spikes.

Rolling standard deviation of daily returns for SPY and TLT from 2003 to 2008 using a 20-period window
I don't have easy access to historical option information, but it would be interesting to compare TLT's implied volatility to that of the SPY over the same date ranges.  I have to imagine bond IV has increased, but I don't know this for a fact.

All of this is interesting and confirms what we traders already know, namely that the bond market has been acting strange in recent years, but it isn't tradable.  What can you do with this?  Damned if I know.  Personally, I'm short both bonds and stocks.  There is reasonable implied volatility in the bonds still so I'm selling puts against my shorts.