Portfolio Activity

The oil market feels heavy, I am going to sell 250 OIL (50%) of my holding @ the open with the hope of buying it back a little lower.

Feeling a little edgy about the portfolio, want to do more but have no true sense of where things are headed, other than my research telling me the markets are expensive. The core of this portfolio is designed to trade for the long term, with some light sprinkling of tactical trading around the (h)edges.

oil1

Volatility Clustering

In case you thought volatility is isolated, the charts below give you an idea of how volatility leads to more volatility – duh! Knowing this doesn’t license you to print money, life would be way too boring if that was the case. The problem is not knowing that volatility cluster it is that we have no idea how long we will stay in a low or high volatility environment and its amplitude. In essence the billion dollar question is identifying when an environment regime shifts.

There is a ton of research in this area, and I have to confess I am attracted to the hidden Markov chain process in the shorter time horizons. Later in the year I hope to share some of my research into this subject. Let’s get back to the clustering:

In the top chart I look at the S&P500 on a rolling 100 days with 2% or more moves, and the bottom chart shows the Shanghai Stock Index which took a 7% bath yesterday, and with GDP numbers coming out later today promises to provide further fireworks. What I can say about the comparative 2 charts is that China is starting to look like its entering a more volatile period ahead of the US.

For those interested in the R code I have included it as well. (Hat tip to John Hussman for the graphic idea, I wish my code were more elegant, but I think it does the job, ignore the errors about my labelling).

SP500

SP500

Shanghai Stock Index

Shanghai Stock Index

require(quantmod)
require(PerformanceAnalytics)
 
#get the data
getSymbols('^SSEC', from='1990-01-01')
 
#lets look at it from 1990 to 2015
#spy <- SPY['1990/2015']
Shang<- SSEC['1990/2015']
 
#our baseline, unfiltered results
ret <- ROC(Cl(Shang)) 
 
#our comparision, filtered result
filter.d <- Lag(ifelse(ret < -0.02, 1, 0))
drops<- rollapply(filter.d==1,100,sum)
filter.g <- Lag(ifelse(ret < 0.02, 1, 0))
gain<- rollapply(filter.g==1,100,sum)
 
plot(drops, main = "Drop and Gain Clustering", sub = "sum of 2% movements over 100 prior days", ylab ="drops")
par(new=T)
plot(gain, main = "Drop and Gain Clustering", labels = FALSE, col = "red")
axis(side =4)
mtext("gains", side = 4)

Created by Pretty R at inside-R.org

Shiller PE Model

I am on a roll, I thought I would pull out my pride and joy the Shiller PE model and see what it has to say.

Rplot
2015-01-15_1652

Now we are talking you can see significant outperformance. Here we are looking at more than 114 years worth of data. I guess that would include all cycles 😉

Before I get too carried away I was a bit concerned with the date structuring over the last year. I have used data from Quandl’s (MULTPL) dataset and I seem to be getting signals more than 1 per month. According to the model it is currently invested and long.

2015-01-15_1658

I am going to post the code below, but I am warning that I plan to do a little bit of work in the near future to double check if I am manipulating the dates correctly. Enjoy if this is your thing.

library(quantmod)
library(PerformanceAnalytics)
library(gridExtra)
 
# I am pulling the data from Quandl and the MULTPL dataset. 
multpl<- read.csv('https://www.quandl.com/api/v1/datasets/MULTPL/SHILLER_PE_RATIO_MONTH.csv?trim_start=1881-01-01&trim_end=2015-12-17&auth_token=kvYEqCqKCTyL4anWz5Zv', colClasses=c('Date'='Date'))
snp<- read.csv('https://www.quandl.com/api/v1/datasets/MULTPL/SP500_REAL_PRICE_MONTH.csv?trim_start=1871-01-01&trim_end=2015-12-17&auth_token=kvYEqCqKCTyL4anWz5Zv', colClasses=c('Date'='Date'))
 
date<- snp$Date
values<- snp[,2]
snp.obj<- as.xts(values, order.by = as.Date(date, "%d/%m/%Y"))
snprets<- ROC(snp.obj, type = "discrete", n = 1)
 
date<- multpl$Date
values<- multpl[,2]
PE.obj<- as.xts(values, order.by = as.Date(date, "%d/%m/%Y"))
 
Shiller<- merge(snp.obj,PE.obj, snprets)
Shiller.sub = Shiller['1900-01-01::']
colnames(Shiller.sub) = c('S&P500','Shiller PE','S&P500 returns')
 
mean<- rollapply(PE.obj,48,mean)
sdsig<- rollapply(PE.obj,48,sd) + mean
over<- Lag(ifelse(PE.obj> sdsig,1,0))
 
pe_ret <- snprets * over
PEtimer<- cbind(pe_ret,snprets) 
colnames(PEtimer) = c('PE-Timer','Buy&Hold')
 
maxDrawdown(PEtimer)
grid.newpage(recording = FALSE)
grid.table(tail(over))
tail(over)
grid.newpage(recording = FALSE)
grid.table(table.AnnualizedReturns(PEtimer, Rf=0))
table.AnnualizedReturns(PEtimer, Rf= 0)
charts.PerformanceSummary(PEtimer, Rf = 0, main="Shiller PE Timer",geometric=FALSE)

Created by Pretty R at inside-R.org

Oil & Dr Copper

The one position in my current portfolio that is losing money is the crude oil position. Is this a concern? No not really my view is simple, oil is not going to zero at least not for the foreseeable future. There is natural demand for oil it isn’t a product like an iPhone or Twitter. Oil carries a lot of geopolitical inputs into its market price and therefore is prone to over reactions and excessive volatility.

Now I love trading market extremes, this has been my catchphrase for more than a decade. Knowing that oil has a bottom gives me confidence to take on this trade. I haven’t done an exhaustive analysis of how far from its mean and a host of other technical indicators to do this trade. For me it is simply heavily oversold and for me following all the news in the media this is a classic example of what my book calls a “market complex”. Can it get even more oversold, hell yes but that will present even a better buy opportunity. For now I am probably going to keep my powder dry. I have a healthy lead on my benchmark and don’t see any reason to be aggressive.

oil

I thought I would also just highlight the price weakness in copper, as many call it Dr Copper for its qualities in forecasting economic conditions. Copper in the longer term chart show perennial weakness since 2012 and today it is in freefall.

Dr Copper

copper 15 min

Correlation ≠ Causation

I just had to put this point down on paper. I was thinking about it earlier and wanted to highlight the point with a strong visual image. I will go into more depth in one of my Sunday letters next year and show how prevalent this line of thinking is in trading.

How silly we seem to be seeing spooks in the dark. Actually there is something called the “confounding variable” which is one of the factors that steers us off course. More about it in the new year.

Lets keep this a little light into the new year. 😉

 

S&P500

Lets take a closer look at the recent sell-off which is starting to shake some of that bullish belief.

Lets start at a look at the rally from the bottom in March 2009.

Now for a closer look at the retracement. I am not calling this market as I don’t have a clue but to think that this retracement is enough, we havent even started. Was that the top last week, lets wait and see.