The most important charts of 2012

Business Insider posted a great year end wrap-up of charts. I thought I’d post a couple of my own favorite charts and then highlight some of theirs. Its long but well worth checking out.

Don’t take our word for it : Several asset managers make long term stock market return forecasts that are very low. Interesting but this is unrelated to short term drivers of the market.

Gangnam Style viral video sends DI corp to stratosphere and back again. Source: Bloomberg

Now onto some of the great charts posted at business insider.
The Most Important Charts of 2012

I thought I would stay away from too many Europe, Fiscal Cliff or Apple slides since they have dominated the media. Having said that, lets start with the one Europe slide….

Europe certainly influenced trader perceptions for the last couple years. However, the 4-year presidential cycle did provide some guidance to traders…

And yet the market was also tremendously intervention and monetary policy driven….

Deleveraging has dominated headlines as well, including on this blog. But while the private sector is deleveraging the public sector is largely offsetting this:

Looking under the hood, the economic returns to debt growth are diminishing and have been for decades. They are quickly approaching zero:

While some of the economic fundamentals don’t look spectacular, the market has done reasonably well this year. You wouldn’t know that consumers were deleveraging from the absolute and relative performance of the consumer discretionary sector:

Some of this strength is being caused by the recovery in housing and rally in housing stocks:

Another key insight that has proven useful in navigating this market cycle is the sectoral balances analysis approach seen below. I’m still working on incorporating this into my investment approach.

Looking at the long term now, demographics will likely play a role in driving asset prices. This chart looks to bearish to me but there will certainly be a drag in some markets with the number of retirees growing and working age population shrinking.

Lastly, an interesting chart trying to time the market using relative hedge fund exposure. Interesting take, might need some further investigation.

Source: The Most Important Charts of 2012

Advertisements

Dashboards for Technical Analysis: Visualizing Sector Rotation Relative Strength

One of the biggest challenges of trading is getting the right information into a format where you can make decisions effectively without being bogged down by the unnecessary. Today I thought we could look at a tool I built in excel to better understand trends in sector rotation. The idea came from one Mebane Faber’s Idea Farm publications from a research paper written by Ineichen Research and Management AG entitled Wristons Law of Capital.

Lets take a look at one of their great visualizations:


Source: Ineichen Research and Management AG, Mebane Faber’s The Idea Farm, 1, 2

Ineichen goes on to look at not only high frequency economic indicators but risk, general economic indicators and many others. Check out the report and see it for yourself.

This is a great visualization technique so I thought, why not apply it to technical analysis concepts? So I started testing out the idea by looking at sector rotation in a similar dashboard format:

Here we have each sector ETF’s relative strength trend against the SPY (S&P500 ETF), so if the XLF (Financials) is outperforming the SPY (SP500 ETF) it would be green. The SPY is plotted above the relative strength matrix with its 50 and 200 day moving averages. The specific relative strength calculation looks to see if the ratio of the two ETFs is above or below its 20 day moving average. I also categorized each sector ETF into Early, Late or Counter cyclical to be able to better see the progression throughout the business cycle, although there is debate surrounding this technique because no relationship is everlasting in the markets. Lastly, I reversed the colour scheme on the counter cyclical ETFs so that if they are under performing the index, they turn green. The reason for this is to look at the sector rotation composite as a means to time exposure to the market index, so the more green you have, the better the underlying internals of the market. I’m still playing around with this concept and trying to figure out the best way of incorporating the late cycicals.

As you can see, this is a powerful visualization tool that can help a trader read the meta-communications of the market. It is not limited to sector rotation. I’ve seen dashboards looking at breadth and various other techniques. Personally, I plan on incorporating breadth extremes, DeMark counts, different economic indicators, and even highlighting exogenous events like policy interventions. Whatever information you find useful about the market can be combined in a way to streamline your decision making process for trading to be able to make better decisions more effectively. I’d love to hear some suggestions for what kind of information would be useful to look at in this manner if you have any, post a comment below!

Cheers, and happy trading

Looking at gold stock intraday and overnight returns in R

I came across an interesting post recently: Kaeppel’s Corner: The Greatest Gold Stock System You’ll Probably Never Use. It describes how most of the returns from gold stocks have come from overnight gaps (Open – Previous Close) vs intraday (Close – Open). I’ve known about the overnight/intraday anomaly for a while but haven’t seen it this pronounced before. So I thought it was a good time to do some digging on my own with the help of Systematic Investor’s Toolbox in R.

First, let’s initialize the Systematic Investor Toolbox, download the ‘GDX’ data from yahoo and plot a chart.

###############################################################################
# Load Systematic Investor Toolbox (SIT)
# http://systematicinvestor.wordpress.com/systematic-investor-toolbox/
###############################################################################
setInternet2(TRUE)
con = gzcon(url('http://www.systematicportfolio.com/sit.gz', 'rb'))
source(con)
close(con)

#*****************************************************************
# Load historical data
#******************************************************************
load.packages('quantmod')
require(PerformanceAnalytics)

#http://www.optionetics.com/marketdata/article.aspx?aid=24606
data.GDX = getSymbols('GDX', src = 'yahoo', from = '1994-01-01',auto.assign = FALSE)

gdxdata = data.GDX['1995::']

GDXret = cumprod(ifna(Cl(gdxdata)/lag(Cl(gdxdata),1),1))
plota(gdxdata, type = 'candle', main = 'GDX')

GDX is essentially rangebound over its lifetime with tremendous volatility. Not a buy and hold investment for sure! Lets look at the overnight and intraday cumulative returns:

GDXovernight = cumprod(ifna(Op(gdxdata)/lag(Cl(gdxdata),1),1))
GDXintraday = cumprod((Cl(gdxdata)/Op(gdxdata)))
GDXintraday.rev = cumprod(1/(Cl(gdxdata)/Op(gdxdata)))

plota(GDXintraday, type = 'l', main = 'GDX intraday vs overnight', ylim = c(min(GDXintraday),max(GDXovernight)), col = 'black', log = 'y')
plota.lines(GDXovernight, type = 'l', main = 'GDX curves', col = 'blue')
plota.legend(c('intraday','overnight'),c('black','blue'))

The results are very similar to ones in the Optionetics blog post with the overnight return producing tremendous gains and the intraday return huge losses. The only thing that is different is that I’m compounding the returns vs holding 100 shares. However, the shape of the graph is virtually the same.

Next let’s look at what happens when we go long the overnight session and short the intraday. I’m also going to add on the 12 month return, drawdown and 20 day intraday/overnight volatility to get a better picture of whats going on.

starting.equity = 100000
GDXstrat = starting.equity*GDXintraday.rev*GDXovernight

GDX.intraday.vol = ifna(100*sqrt(252) * bt.apply.matrix((Cl(gdxdata)/Op(gdxdata))-1, runSD, n = 20),0)
GDX.overnight.vol = ifna(100*sqrt(252) * bt.apply.matrix(ifna(Op(gdxdata)/lag(Cl(gdxdata),1)-1,0), runSD, n = 20),0)

layout(1:4)
plota(GDXstrat, type = 'l', main = 'GDX: short open - long close', ylim = range(GDXstrat), log = 'y', col = 'blue')
GDX.12mroc = ifna(100 * (GDXstrat / lag(GDXstrat, 255 ) - 1),0)
plota(GDX.12mroc, type = 'l', main = '12m ROC', ylim = range(GDX.12mroc), col = 'green')
GDX.dd = 100 * compute.drawdown(GDXstrat)
plota(GDX.dd, type = 'l', main = 'Drawdown', ylim = range(GDX.dd), col = 'red')
plota(GDX.intraday.vol, type = 'l', main = 'GDX 20-period Volatility', ylim = range(GDX.intraday.vol), col = 'cyan')
plota.lines(GDX.overnight.vol, type = 'l', main = 'vol.overnight', ylim = range(GDX.overnight.vol), col = 'purple')
plota.legend(c('intraday','overnight'),c('cyan','purple'))

Much better visualization of the properties of this strategy. Of course, it transacts twice a day, so there will be huge impacts from commissions, slippage, etc so it may not be feasible to trade. Nevertheless, it is an interesting phenomena and I wonder what in the underlying market structure is causing it.

Finally, I changed the symbol in the code and outputted the same graph for ‘NUGT’ the triple leveraged gold stock ETF. The results are consistent although the magnitude of returns and volatility and much greater.

Solo climbing….

Every once in a while you see something that pushes the boundaries of physical achievement. In the following video, Alex Honnold shows off solo climbing, which is the sport of climbing without any ropes or harnesses. Crazy? Perhaps. Nevertheless, Alex is a role model in showing us how to push beyond conventional limits…Very cool video