Tuesday, December 26, 2006

Do Factor Models Work in the Short Term?

Besides pair-trading, “factor model” is the most popular workhorse of the statistical arbitrageur. In a previous article, I discussed the most well-known factor model – the Fama-French Three-Factor model, with the general market index returns, the market-cap of the stock, and the book-to-price ratio as the only three factors driving returns. However, as I explained earlier, this factor model has a very long horizon. For the quantitative trader who needs to make money every month, the natural instinct is to look for a more “sophisticated” factor that works in the short term, or even to develop some kind of model that use different factors every month in response to “market condition”. Alas, other than hearsays and second-hand gossips, I have never witnessed an actual success of this approach in a hedge fund or proprietary trading group – at least a success that lasts for more than a year.

I am of course not privy to the current performance numbers of factor models run by some of the most successful hedge funds today. However, there is a class of ETF (called “XTF”) marketed by PowerShares Capital Management that uses a similar factor approach for its stock selection criteria. According to media reports, each stock in these XTF’s is scored by 25 variables such as cash flow, earnings growth, price momentum, etc. This sounds like a classic factor model to me. This model is reportedly designed by the quantitative unit at American Stock Exchange. To find out if they have indeed discovered the holy grail of factor models, I looked at the performance of these XTF compared to their benchmarks.

Here I tabulate the XTF’s for each market cap and value category, their corresponding benchmark market index ETF’s, and finally the YTD differential returns up to December 13, 2006. (PJG and PJM have too short a history for this comparison.)










ValueBlendGrowth
Large capPWV-IVE=4.8%PWC-IVV=-3.6%PWB-IVW=-5.0%
Mid capPWP-IJJ=0.1%PJG-IJH=N/APWJ-IJK=3.1%
Small capPWY-IJS=-0.7%PJM-IJR=N/APWT-IJT=-4.9%




The differential returns are all over the place: some positive, others negative. To me, this is symptomatic of a factor model that does not have predictive power. (After all, if the differential returns are consistently negative, we could have long the ETF, short the XTF, and make consistent profits!) At the very least, this factor model may have a horizon much longer than what most traders would be interested in – in which case, why not just use the simple Fama-French model?

This is not to say that exotic, proprietary factor models have no use: they tend to be pretty useful for risk management, as volatilities and correlations are often easier to predict than returns. But beware every time your risk management software vendor tries to sell you an alpha generator!

Tuesday, December 19, 2006

Another limitation of artificial intelligence and data mining

Sometime ago I espoused my views that AI and data mining techniques may not be suited for predicting financial markets. Here we have an article from the Chief Scientist at IBM's Entity Analytic Solutions Group who believes these techniques are not fit for counterterrorism either. Why? The same reasons I mentioned: not enough historical data.

Thursday, December 14, 2006

DNA, cryptology, speech recognition, and trading

There is an interesting New York Times article on a mathematician and cryptologist who used to work for the wildly successful hedge fund Renaissance Technologies and is now famous for decoding DNA's. This article caught my eyes because quite a few of my former colleagues from the speech recognition research group at IBM also went over to Renaissance as researchers and portfolio managers. Renaissance is an extraordinary hedge fund in Long Island that has an average annual return of 35% since 1989, after charging 5% management fee and 44% incentive fee. They profess to hire only scientists, engineers and mathematicians with as little background in finance as possible. They started off trading futures, but has since then diversified into equities models, and is reportedly raising a $100 billion fund at the moment.

A lot of people want to know the secrets of their success. From the people they hire, one can always guess. The common thread among DNA decoding, cryptography, and speech recognition is information theory, the discipline founded by legendary Bell Labs mathematician Claude Shannon. There are a few tools in information theory that have found wide-spread applications: hidden Markov model is one, expectation-maximization (EM) algorithm is another, and then of course the grandfather of prediction: Bayesian statistics. Needless to say, I have tried them all in my own trading research, but have not met much success so far. Aside from the limitations of my imagination, I suspect the reason is that these tools work much better with higher frequency data than the daily data that I have thus far worked with. Therefore I am not ready to give up yet. (Readers of my earlier article on artificial intelligence may think that I am being inconsistent here, as I was less than enthusiastic about the application of that discipline to trading. There is, however, quite a big difference between information theory and artificial intelligence. The former is characterized by sophisticated theory with very few parameters, the latter, simple theory with a lot of parameters.)

There is one published trading model that is based squarely on research in information theory. It is called Universal Portfolios, created by Stanford information theorist Prof. Thomas Cover. It is an elegant and quite intuitive model, but I don't know how well it performs under realistic conditions. I hope to write about some of my research on this and a related class of models in a future article.

Further reading:

Cover, Thomas M. and Thomas, Joy A. (1991), Elements of Information Theory. John Wiley & Sons, Inc.

Sunday, December 10, 2006

Market-cap and growth-value arbitrage

Predicting whether small-cap or growth stocks will outperform large-cap or value stocks in the next quarter is a favorite pastime of financial commentators. To many financial economists, however, the question is long ago settled by the so-called Fama-French Three-Factor Model. This model postulates that the returns of a stock depend mainly on 3 factors: the general market index returns, the market-cap of the stock, and the book-to-price ratio. Furthermore, as an empirical fact, over the long term (i.e. for any 20-year period), small-caps beat large-caps by an average compounded annual rate of 3.12%, and value stocks beat growth stocks by 4.06% (the latter result applies when we confine ourselves to the large-cap universe).

This model is very convenient to us arbitrageurs. Statistical arbitraguers generally don’t know how to predict market index returns, but we can still make a living in a bear market by buying a small-cap, value portfolio and shorting a large-cap, growth portfolio, and expect to earn 3-4% (on one-side of capital) a year. For example, despite the much anticipated imminent demise of small-caps over the last year or so, I found that if we long the small-cap value ETF IJS, and short the large-cap growth ETF IVW from November 15, 2005 to November 15, 2006, we would have earned about 10% return. The 3-4% average returns look meager, but note that since this is a market-neutral, self-funding portfolio, your prime broker (if you trade for a hedge fund or a proprietary trading firm) will allow you to leverage this return several times.

Some traders will find 20 years a bit too long. Is there any help from academic theory on whether small-cap value will outperform large-cap growth next month, and not next 20 years? A recently published article by Profs. Malcom Baker and Jeffrey Wurgler says there is. (Mark Hulbert wrote a column explaining this in the New York Times recently.) The gist of this article is that when market sentiment is positive, expect small-caps to underperform large-caps by 0.26% a month, and value stocks to outperform growth stocks by 1.24% a month. Conversely, when the market sentiment is negative, expect small-caps to outperform large-caps by 1.45% a month, and value stocks to underperform growth stocks by 1.04% a month. How one computes “sentiment” is complicated: it is a linear combination of 6 variables: closed-end fund discount, NYSE share turnover, number and first-day returns on IPOs, equity share in new issues, and the dividend premium. (The authors used data from 1963-2001 for this study.) Now, without actually computing all these variables, most would agree that the current sentiment (as of December 2006) is fairly positive. This implies, as Mr. Hulbert noted, that small-cap will underperform large cap in the coming months, contrary to the long-term trend. However, the other long-term trend, that value will beat growth, will still hold in the near future. It is up to the reader to find a pair of ETF’s that will take maximum advantage of this prediction, but I will help here by tabulating some of the available funds.







 ValueBlendGrowth
Large capIVEIVV/SPYIVW
Mid capIJJIJHIJK/JKH
Small capIJSIJRIJT


Further reading:

Bernstein, William (2002), The Cross-Section of Expected Stock Returns: A Tenth Anniversary Reflection.
O’Shaughnessy, James P. (2006), Predicting the Markets of Tomorrow. Penguin Books.

Monday, December 04, 2006

Artificial intelligence and stock picking

There was an article in the New York Times a short while ago about a new hedge fund launched by Mr. Ray Kurzweil, a poineer in the field of artificial intelligence. (Thanks to my fellow blogger Yaser Anwar who pointed it out to me.) The stock picking decisions in this fund are supposed to be made by machines that "... can observe billions of market transactions to see patterns we could never see". While I am certainly a believer in algorithmic trading, I have become a skeptic when it comes to trading based on "aritificial intelligence".

At the risk of over-simplification, we can characterize artificial intelligence as trying to fit past data points into a function with many, many parameters. This is the case for some of the favorite tools of AI: neural networks, decision trees, and genetic algorithms. With many parameters, we can for sure capture small patterns that no human can see. But do these patterns persist? Or are they random noises that will never replay again? Experts in AI assure us that they have many safeguards against fitting the function to transient noise. And indeed, such tools have been very effective in consumer marketing and credit card fraud detection. Apparently, the patterns of consumers and thefts are quite consistent over time, allowing such AI algorithms to work even with a large number of parameters. However, from my experience, these safeguards work far less well in financial markets prediction, and over-fitting to the noise in historical data remains a rampant problem. As a matter of fact, I have built financial predictive models based on many of these AI algorithms in the past. Every time a carefully constructed model that seems to work marvels in backtest came up, they inevitably performed miserably going forward. The main reason for this seems to be that the amount of statistically independent financial data is far more limited compared to the billions of independent consumer and credit transactions available. (You may think that there is a lot of tick-by-tick financial data to mine, but such data is serially-correlated and far from independent.)

This is not to say that quantitative models do not work in prediction. The ones that work for me are usually characterized by these properties:

• They are based on a sound econometric or rational basis, and not on random discovery of patterns;
• They have few or even no parameters that need to be fitted to past data;
• They involve linear regression only, and not fitting to some esoteric nonlinear functions;
• They are conceptually simple.

Only when a trading model is philosophically constrained in such a manner do I dare to allow testing on my small, precious amount of historical data. Apparently, Occam’s razor works not only in science, but in finance as well.

Wednesday, November 29, 2006

Does Canada belong to the Emerging Markets?

Many of us Canadians like to think of our economy as a member of the advanced, post-industrial world, with the landscape dotted with brand-name companies such as Nortel Networks, Research In Motion, and Four Seasons Hotels. In the back of our minds, of course, we know we are also a resource-rich country. But still, it may come as a bit of an embarrassment to find out that, of all the sector index funds we can compare the MSCI Canada Index fund EWC to, it cointegrates only with the natural resource index fund IGE. Even the financial sector indices do not come close, despite the presence of numerous financial services companies in the Canada Index. As usual, in the chart below, I plotted the spread between 100 shares of IGE and 400 shares of EWC, and we can see for ourselves how this spread stubbornly sticks close to zero.






One may note that IGE also cointegrates with the Emerging Markets index fund EEM. (The chart below is the spread between 100 shares of IGE and 100 shares of EEM.)


This is not surprising. But does this imply the unsettling conclusion that the Canadian economy cointegrates with the emerging markets? No. I will not bore you with yet another chart: just be assured that cointegration is not a transitive relation.

Friday, November 24, 2006

Trading a platinum-gold seasonal spread

Quantitative traders can sometimes lose sight of the fact that many profitable trading strategies are extremely simple, requiring no math at all. Such is the case with a seasonal spread trade between platinum and gold that was profitable in all but one of the last 7 years. This is far more consistent than the seasonal spread trade that ruined Amaranth (see my earlier article).

The strategy is extremely simple: buy 2 July contracts of PL and short 1 June contract of GC around the end of February, and exit the positions around mid-April. (The gold futures contract specifies 100 ounces, while platinum is only 50, therefore we need to buy 2 contracts of PL vs. 1 contract of GC.) I first read about this strategy in an article by Jerry Toepke in the SFO Magazine in the beginning of 2006 and I decided not only to backtest it, but also paper trade this strategy in 2006 to see if it works its magic again. Both the backtest and the paper trade worked as advertised, despite being widely publicized by the magazine. I plot the P/L in this chart:


This spread earned an average of $6,600 every year since 1995. We earned $15,400 in the best year, while in the worst year we lose only $3,810. With a margin requirement of only $743 for trading this spread at NYMEX, the return per trade is not bad!

What is the fundamental reason this seasonal spread works? Amusingly, it has to do with the end of the Chinese New Year. According to Mr. Toepke, the demand for gold is driven by demand for jewelry. Asian countries such as India and China are the largest consumers of gold. A series of festivals and celebrations in these countries around year-end lasted till the end of the Chinese New Year in February, after which demand for delivery of gold is seasonally exhausted. Platinum, on the other hand, is primarily used in catalytic converters for automobiles, and the seasonality is much weaker. It is therefore handy as a hedge for gold prices.

Further reading: Jerry Toepke, “Give Seasonal Spreads Some Respect”, Stocks, Futures and Options Magazine, January 2006 issue.

Tuesday, November 21, 2006

Cointegration of OIH with spot oil price

Both my friend Yaser Anwar over at the Investment Ideas blog and my reader Jim urged me to test the oil services ETF OIH instead of XLE for cointegration with crude oil price. Their reasoning is that OIH is composed of oil drilling companies such as Schlumberger and Baker Huhges, as opposed to XLE, which is composed of oil-production companies like Exxon. The oil-drillers are more cyclical and react more to spot oil price rather than far futures contract prices. The hope is that OIH will tend to cointegrate better with spot oil price than XLE because of this. The fact that OIH has higher volatility as a result is not a concern to the arbitrageur (as opposed to the hedger), who profits from high volatility. In any case, its volatility should “cancel out” that of the spot oil price and result in a spread that may actually be less volatile. I follow their advice and carry out the analysis of CL vs. OIH.



The plot is of the dollar value of long 1 contract of Cl and short 497 shares of OIH. They do cointegrate with over 90% probability. (I also plotted the 1 standard deviation lines of the spread to facilitate those who want to look for approximate entry points.) The cointegration probability is not measurably better than that between CL and XLE. However, the current spread (as of the close of Nov 20) is undervalued by only $9,617 (or 1.48 standard deviation), as opposed to $10,508 (or 1.74 standard deviation) for the CL-XLE spread. (I determined the standard deviation of the CL-XLE spread to be about $6,040). So in recent months, one can indeed say that OIH is trading more in line with spot oil price than XLE. But as an arbitrageur who thinks the larger the spread, the bigger the profit opportunity, this is not an endorsement for buying the CL-OIH spread instead. Rather, I would consider adding this spread as a means of diversification.
Thanks, Yaser and Jim, for this suggestion!

Monday, November 20, 2006

Extended analysis of energy futures and stocks arbitrage

A reader of my article “An arbitrage trade between energy stocks and futures” suggested that I should look at a longer history of crude oil prices vs. XLE. So I performed the same cointegration analysis for the front-month crude oil futures contract CL vs. XLE since December 1998. (I use CL instead of QM, the mini crude oil contract, due to its longer history.) Here is the plot of the dollar value of long 1 contract of CL and short 1,217 shares of XLE. (My previous analysis called for 1 contract of QM vs. 640 shares of XLE. The difference in shares is due to the half-size of QM relative to CL, and also to the larger dataset here.)


An interesting feature emerged from this extended analysis. CL and XLE are still found to be cointegrated over this long period, albeit with a slightly lower probability (90%). However, we can see something of a regime shift around mid-2002, when CL went from generally under-valued to over-valued relative to XLE. (Even after including this regime with lower relative crude oil prices in my calculations, I still find the current spread to be undervalued by about $10,521 as of the close of Nov 17, which is near its 6-year low.)

What was the reason for this apparent shift in mid-2002? And are we in the middle of a similar regime shift in the opposite direction? Maybe our readers who have a better grasp of the economic fundamentals of the energy markets can shed light on this.

Sunday, November 19, 2006

Email subscription to my blog now available

Instead of checking this blog constantly for new postings, you can now sign up to receive an email whenever a new article appears. Please see the "Enter your email" box on the right sidebar. You can of course unsubscribe at anytime, and your email will not be shared with anyone else without your permission.

Saturday, November 18, 2006

Correction: Maximizing Compounded Rate of Return

A few readers pointed out a typo and an arithmetic error in my article "Maximizing Compounded Rate of Return". In the geometric random walk example where the stock can go up or down 1% at every step, the mean rate of return m is 0%, (not 1%), and the compounded rate of return is -0.005% (not -0.5%). My sincere thanks to all my readers who mercilessly scrutinize my ideas and check my numbers!

Friday, November 17, 2006

Reader suggested a possible trading strategy with the GLD - GDX spread

Steve Hansen of Raymond James Ltd. in Vancouver, B.C. suggested to me that a good trading signal for the GLD - GDX spread is when it exceeds 2 standard deviations from its mean. He observed that these are roughly at +/- $250 based on my definition of the spread, and that there were 3 such (immensely profitable) signals since the inception of GDX. Here is Mr. Hansen's plot:





This certainly looks like a fairly safe strategy. Of course, if one desires more frequent signals, one can always enter into smaller positions at smaller spread values.

By the way, just when we were celebrating the reversion of the GLD - GDX spread this morning, the QM - XLE spread plunged to another multi-year low. With crude oil prices down about 30% from its all-time-high, XLE, the energy stocks ETF, is still within 5% of its all-time high. Does this make any sense? We shall see after this quarter's earnings from the oil companies are announced ...

GLD-GDX spread reverted to 0 this morning

Just a quick note on the GLD-GDX spread that I have been talking about. This morning (Nov 17) the negative spread completely reverted and has gone into positive territory.

Sunday, November 12, 2006

An updated analysis of the arbitrage between gold and gold-miners

In my article about the arbitrage opportunity between gold and gold-miners, I cautioned that we should take the analysis with a grain of salt because of the short history of GDX (a gold-miners ETF). Adam Phillips of Van Eck Global, the firm which created GDX, has kindly pointed out to me that GDX is designed to track the Amex Gold Miners Index, GDM, which has a much longer history. Hence I repeated the analysis with gold spot prices vs. GDM for the last 3 years. The results confirm my earlier analysis with much higher statistical significance: GDM cointegrates with gold prices with over 99% probability. Here I plot the difference between the spot prices of 6.1 troy ounce of gold and the GDM index multiplied by 3.68 (to compare with my earlier plot, I normalize the gold prices and the GDM index so that the Gold-GDM spread yields roughly the same dollar value as the GLD-GDX spread at any time):



The mean-reversion of this spread is even more obvious than my plot in the earlier article. Also, with the longer history, we get a much better feel for the range of fluctuations. While the value of the spread is about -$213 as of the close of Nov 9, it can certainly go much lower before reverting, based on the highs and lows of the last 3 years.


FOOTNOTE

A reader of my earlier article made an interesting comment about shorting ETF’s such as GDX and GLD. He argued that since ETF shares can be constantly created, it should not require existing shares to be borrowed for shorting. I asked Mr. Phillips of Van Eck Global about this, and he confirmed to me that a newer ETF like GDX can in fact be hard to borrow. He went on to say that the borrowing of ETF’s has nothing to do with the issuer. The issuer can indeed create an unlimited supply of the shares, but the trader still need to borrow them from his or her broker for shorting. He also told me he is currently working hard to eliminate any borrowing problems in GDX that may have existed.

Friday, November 10, 2006

A commodities fund manager's comments on gold vs gold-miners arbitrage

John Netto, a principal in a commodities fund that focuses heavily on gold, wrote me the following concerning my article on arbitrage between gold and gold-miners: "... there is a paradox that exists in many instances with gold companies and the underlying metal, which could potentially unwind most pairs traders. This is the dynamic of non-recourse loans that companies take on when doing a project. This would never show up in a quantitative model but can put companies in a position that when gold rises, they can get hurt to some degree. Banks that do non-recourse loans require the companies to sell futures to guarantee payment for the project in case the price of gold falls. This way, they will not lose if the project no longer becomes a viable business endeavour. If gold rises, these companies must show massive mark-to-market losses on their books based on new accounting rules. So the theory that gold companies can trade correlated to the price of the underlying is correct, however a dynamic exists that has the potential on a per company basis to materially affect that."

I find Mr. Netto's comments very insightful. I would make one further point: if the mark-to-market accounting losses are temporary and will recover next quarter, we can expect their stock prices to revert. This is exactly the cointegration scenario that I talked about -- a price reversion after some period of time, but not a day-to-day or week-to-week correlation.

Wednesday, November 08, 2006

Are political futures markets really predictive?

Today I will take a brief break from quantitative trading in the financial markets. Instead, I will take a critical look at political futures markets. There has been a lot of enthusiasm lately for such markets (e.g. www.tradesports.com, based in Ireland, is the most popular one.) Media pundits and scholars alike have often said that these markets offer a better prediction of election outcomes than opinion polls, sometimes claiming that they beat polls three-quarters of the time. I have been an avid participant in these markets, but I would like to offer a contrarian view: I believe that these markets often follow, rather than predict, events. The so-called “predictability” of these markets is often ill-defined. The prediction changes constantly over time, and so depending on when you take a snapshot of the markets, you can always find an instant when, retrospectively, the prediction matches the actual election outcomes very closely.

As an example, I watched with amusement the tradesports.com futures market prediction of the Virginia Senate race between Democrat Jim Webb and Republican George Allen. This is one of the two close races that will determine the control of the Senate. For months, the market predicts that the Democrat will lose (the probability of winning, which is the same as the price divided by 100, is always below 50% until the beginning of November). Then in November, the market began to see the light, and started to predict a Democratic win. See the chart below.



But look what happened on the night of the election:



As the vote counts started to be released, the market first thought the Republican was going to win, driving the prices down to the teens. That was due to the votes from the conservative southern Virginia, which were the first to come in. Then, as the vote counts from the more liberal northern Virginia were published at around 11:30 pm, the prices shot up to above $60, and continued on to over $80. Clearly, the market does not know more about the future than your average news anchor.

As someone interested in the predictability of election outcomes based on futures markets, this raises a serious question. What is the proper time to take a snapshot of the market? Should it be 1 month before the election (in which case this market prediction failed, presuming a Democratic win after the recount)? Or should it be 1 week before the election, in which case this market prediction succeeded? And without an answer to this question, how can one claim whether the prediction is accurate or inaccurate?

Monday, November 06, 2006

Cointegration is not the same as correlation

A reader asked me recently why I believe that energy stock prices (e.g. XLE) are correlated with crude oil futures front-month contract (QM). Actually I don’t believe they are necessarily correlated – I only think they are “cointegrated”.

What is the difference between correlation and cointegration? If XLE and QM were really correlated, when XLE goes up one day, QM would likely go up also on the same day, and vice versa. Their daily (or weekly, or monthly) returns would have risen or fallen in synchrony. But that’s not what my analysis was about. I claim that XLE and QM are cointegrated, meaning that the two price series cannot wander off in opposite directions for very long without coming back to a mean distance eventually. But it doesn’t mean that on a daily basis the two prices have to move in synchrony at all.

Two hypothetical graphs illustrate the differences. In the first graph, stock A and stock B are correlated. You can see that their prices move in the same direction almost everyday.

Now consider stock A and stock C.

Stock C clearly doesn’t move in any correlated fashion with stock A: some days they move in same direction, other days opposite. Most days stock C doesn’t move at all! But notice that the spread in stock prices between C and A always return to about $1 after a while. This is a manifestation of cointegration between A and C. In this instance, a profitable trade would be to buy A and short C at around day 10, then exit both positions at around day 19. Another profitable trade would be to buy C and short A at around day 31, then closing out the positions around day 40.

Cointegration is the foundation upon which pair trading (“statistical arbitrage”) is built. If two stocks simply move in a correlated manner, there may never be any widening of the spread. Without a temporary widening of the spread in either direction, there is no opportunity to short (or buy) the spread, and no reason to expect the spread to revert to the mean either.

For further reading:

Alexander, Carol (2001). Market Models: A Guide to Financial Data Analysis. John Wiley & Sons.


Thursday, November 02, 2006

Gold vs. gold-miners: another arbitrage opportunity?

Recently there is mounting interest in buying gold (for example, see this report at TheStreet.com). I am not much of a fundamental analyst, so I won’t go into the economic reasons whether to own or not own gold now. Rather, I would like to see if there is an arbitrage opportunity here in the midst of all this excitement.

I talked about before why I believe energy futures and energy companies ETF are “cointegrated”, i.e. when their spread wanders far from a mean value, there is a high probability that they will revert to the mean. The same analysis can be made about other pairs of commodity futures and ETF’s. Therefore I apply this to gold.

Looking around for ETF’s that hold gold miners, I found GDX. It started trading on May 23, 2006 and therefore has a relatively short history for us to analyze. We could have paired it against the front-month gold futures contract GC, but this may be inconvenient because one has to rollover the contracts monthly. So instead, we pair it against an ETF that holds gold as a commodity. GLD is one such example. (So is IAU, but GLD is far more liquid.) Using the same Matlab cointegration package that I mentioned in the previous article, I determine that even with the short history, GLD cointegrates with GDX with a 90% probability. Also, the package tells us the proper combination is 60 shares of GLD vs. 100 shares of GDX. So if we form a pair by buying 60 shares of GLD and shorting 100 shares of GDX, we can plot the value over time here:



There were indeed numerous instances of reversion to the mean. I was able to take advantage of the high around mid-July and shorted this spread profitably, and I also bought the spread around the low in early September and exited my positions profitably around mid-September. As of the 1st of November, the spread is once again in sufficiently negative territory to warrant attention.

There are some caveats with trading this spread. First, it is not always easy to borrow GDX or GLD to short. It depends on if your broker has a good securities lending desk. Secondly, the history of GDX is short. So any analysis must be taken with a grain of salt. To overcome this short history, I could have constructed my own basket of gold mining stocks and plot the price of this basket against the gold futures GC. If you intend to invest heavily into this spread, I would definitely recommend doing this piece of hard work.




Wednesday, November 01, 2006

An update on the energy stocks vs futures arbitrage trade

I argued before in the beginning of October ("An arbitrage trade between energy stocks and futures") that energy stocks are overvalued relative to energy futures. At that time, a portfolio of long 1 front month QM (crude oil Emini future contract) and short 640 shares of XLE (energy stocks ETF) has a value of -$2,584. Where is it now? As of the close of October 31, December QM is at $58.725, while XLE is at $55.73 a share. The portfolio is now at -$6,305 (the multiplier for QM is 500). The spread has clearly widened: it is now at a 3-year low.

We are now faced with the usual arbitrage trader's quandary. Is this an unprecendented profit opportunity to double up on this trade, or was this a colossal blunder on my part? I came across this New York Times article about the earnings reports from Exxon and Shell that gave me some comfort. While both energy companies posted huge profits, the article quoted Fadel Gheit, a senior energy analyst at Oppenheimer & Company, that for the fourth quarter, "“the question is not if earnings will decline, the question is by how much.” According to the article, analysts say that for every dollar the price of a barrel of crude oil drops, Exxon forgoes $500 million in profit.

So yes, with my fingers crossed, I am still waiting for the day when this spread closes up.

Tuesday, October 24, 2006

Maximizing Compounded Rate of Return

A simple formula that few traders utilize

Here is a little puzzle that may stymie many a professional trader. Suppose a certain stock exhibits a true (geometric) random walk, by which I mean there is a 50-50 chance that the stock is going up 1% or down 1% every minute. If you buy this stock, are you most likely, in the long run, to make money, lose money, or be flat?

Most traders will blurt out the answer “Flat!”, and that is wrong. The correct answer is you will lose money, at the rate of 0.5% every minute! That is because for a geometric random walk, the average compounded rate of return is not the short-term (or one-period) return m (1% here), but is m – s2/2, where s (also 1% here) is the standard deviation of the short-term return. This is consistent with the fact that the geometric mean of a set of numbers is always smaller than the arithmetic mean (unless the numbers are identical, in which case the two means are the same). When we assume, as I did, that the arithmetic mean of the returns is zero, the geometric mean, which gives the average compounded rate of return, must be negative.

This quantity m – s2/2 holds the key to selecting a maximum growth strategy. In a previous article (“How much leverage should you use?”), I described a scheme to maximize the long-run growth rate of a given investment strategy (i.e., a strategy with a fixed m and s) by leveraging. However, often we are faced with a choice of different strategies with different expected returns and risk. How do we choose between them? Many traders think that we should pick the one with the highest Sharpe ratio. This is reasonable if a trader fix each of his or her bet to have a constant size. But if you are a trader interested in maximizing long-run wealth (like the Kelly investor I mentioned in the previous article), the bet size should always be proportional to the compounded return. Maximizing Sharpe ratio does not guarantee maximal growth for multi-period returns. Maximizing m – s2/2 does.

For further reading:

Miller, Stephen J. The Arithmetic and Geometric Mean Inequality. ArithMeanGeoMean.pdf

Sharpe, William. Multi-period Returns. http://www.stanford.edu/~wfsharpe/mia/rr/mia_rr3.htm

Poundstone, William. (2005). Fortune’s Formula. New York: Hill and Wang.

Monday, October 16, 2006

How much leverage should you use?

Maximizing growth without risking bankruptcy

Many hedge fund disasters come not from making the wrong bets – that happen to the best of us – but from making too big a bet by overleveraging. On the other hand, without using leverage (i.e. borrowing on margin to buy stocks), we often cannot realize the full growth potential of our investment strategy. So how much leverage should you use?

Surprisingly, the answer is well-known, but little practiced. It is called the Kelly criterion, named after a mathematician at Bell Labs. The leverage f is defined as the ratio of the size of your portfolio to your equity. Kelly criterion says: f should equal the expected excess return of the strategy divided by the expected variance of the excess return, or

f = (m-r)/s2

(The excess return being the return m minus the risk-free rate r.)

This quantity f looks like the familiar Sharpe ratio, but it is not, since the denominator is s2, not s as in the Sharpe ratio. However, if you can estimate the Sharpe ratio, say, from some backtest results of a strategy, you can also estimate f just as easily. Suppose I have a strategy with expected return of 12% over a period with risk-free rate being 4%. Also, let’s say the expected Sharpe ratio is 1. It is easy to calculate f, which comes out to be 12.5.

This is a shocking number. This is telling you that for this strategy, you should be leveraging your equity 12.5 times! If you have $100,000 in cash to invest, and if you really believe the expected values of your returns and Sharpe ratio, you should borrow money to trade a $1.2 million portfolio!

Of course, estimates of expected returns and Sharpe ratio are notoriously over-optimistic, what with the inevitable data-snooping bias and other usual pitfalls in backtesting strategies. The common recommendation is that you should halve your expected returns estimated from backtests when calculating f. This is often called the half-Kelly criterion. Still, in our example, the recommended leverage comes to 6.25 after halving the expected returns.

Fixing the leverage of a portfolio is not as easy or intuitive as it sounds. Back to our $100,000 example. Say you followed the (half-) Kelly criterion and bought a portfolio worth $625,000 with some borrowed money. The next day, disaster struck, and you lost 5%, or $31,250, of the value of your portfolio. So now your portfolio is worth only $593,750, and your equity is now only $68,750. What should you do? Most people I know will just stick to their guns and do nothing, hoping that the strategy will “recover”. But that’s not what the Kelly criterion would prescribe. Kelly says, if you want to avoid eventual bankruptcy (i.e. your equity going to zero or negative), you should immediately further reduce the size of your portfolio to $429,688. Why? Because the recommended leverage, 6.25, times your current equity, $68,750, is about $429,688.

Thus Kelly criterion requires you to sell into a loss (assuming you have a long-only portfolio here), and buys into a profit – something that requires steely discipline to achieve. It also runs counter to the usual mean-reversion expectation. But even if you strongly believe in mean-reversion, as no doubt many of the ruined hedge funds did, you need to consider protecting you and your investors from the possibility of bankruptcy before the market reverts.

Besides helping you to avoid bankruptcy, the Kelly criterion has another important mathematically proven property: it is a “growth-optimal” strategy. I.e. if your goal is to maximize your wealth (which equals your initial equity times the maximum growth rate possible using your strategy), Kelly criterion is the way.

Notice this goal is not the same as many hedge managers’ or their investors’ goal. They often want to maximize their Sharpe ratio, not growth rate, for the reason that their investors want to be able to redeem their shares at any time and be reasonably sure that they will redeem at a profit. Kelly criterion is not for such investors. If you adopt the Kelly criterion, there may be long periods of drawdown, highly volatile returns, low Sharpe ratio, and so forth. The only thing that Kelly guarantees (to an exponentially high degree of certainty), is that you will maximize the growth potential of your strategy in the long run, and you will not be bankrupt in the interim because of the inevitable short-term market fluctuations.

For further reading:

Poundstone, William. (2005). Fortune’s Formula. New York: Hill and Wang.

Thorp, Edward O. (1997; revised 1998). The Kelly Criterion in Blackjack, Sports Betting, and the Stock Market. www.bjmath.com/bjmath/thorp/paper.htm

Thursday, October 05, 2006

An arbitrage trade between energy stocks and futures

With a lesson costing 6 billion dollars, Amaranth has taught us an, albeit disastrous, arbitrage trading technique in energy futures: buying the March-over-April spread in natural gas futures, and betting that it will increase in value. Unfortunately for Amaranth and its head trader Brian Hunter, the spread decreased rather than increased in September, resulting in a $6 billion drop in value. Many commentators breathed a sign of relief that this has caused no widespread disruptions in the financial market, reasoning that this is too obscure a corner in arbitrage trading to matter. However, as we learned in the Long Term Capital Management debacle, spreads in the financial markets often move in tandem, especially during times of market stress. Since mid-August, I have been following another obscure spread heading towards a 3-year low, and it may present a profitable trading opportunity.

As oil prices go to historic highs during this past year, energy stocks have followed a similar course. For example, front-month light sweet crude oil E-mini contract QM reached a historic intraday high of $78.30 on July 14, while the energy sector exchange-traded fund XLE reaches its historic intraday high of $60.15 on May 11. Since energy companies typically own rights to oil either above or under ground, it is reasonable that their stock prices follow the price of oil. In technical terms, we say that energy stock price “cointegrates” with the crude oil price, a concept pioneered by the Nobel laureates Robert Engle and Clive Granger. To prove that they do in fact cointegrate, I ran a Matlab cointegration package developed at University of Toledo in Ohio on the closing prices of QM (using a perpetual futures series) and XLE for the last 3 years. The program determined that they cointegrate with a 95% probabilty. Now, what this does not mean is that QM and XLE prices will always move up or down in a similar percentage everyday. This also doesn’t mean that there won’t be periods of time when the spreads between QM and XLE will go way out of sync, just as the gas futures spread did for Amaranth. What this tells us is that with high probability, the spread will eventually goes back to their historic average, and then probably goes in the opposite direction for a while.

To illustrate this point, let’s take a look at a plot of the spreads between QM and XLE over the last 3 years. (Click on the graph twice to enlarge it.) Suppose we are long a front-month QM contract (rolling over the contract every month), and are simultaneously short 640 shares of XLE. The number of shares is determined by the Matlab package mentioned above. The y-axis shows the dollar value of this pair of positions. We can see that in the past 3 years, the value went as high as $5,550 on October 14th, 2004, and as low as -$4,152 on February 16th, 2006. The average is $57, which is almost zero. As of this writing (at the close of September 28, 2006), the value is -$2,584. While this is not near the 3-year low yet, it is getting there. Those who have a strong stomach will buy this spread now, and hope that the value will move back up to it long-run average of near zero. (Click on the graph twice to enlarge it.)

Some people may feel uneasy about trading oil futures because they have to keep rolling over to the next nearby contract every month, or maybe their brokerage doesn’t allow futures trading at all. There is now a convenient alternative: an exchange-traded fund called USO. This fund trades like a stock on the American Stock Exchange, just like XLE. USO closely reflects the value of the nearby contracts in crude oil (with a small percentage that reflects the value of other energy futures such as natural gas or heating oil). And yes, I have checked that it cointegrates equally well, if not better, with XLE.

Some thoughtful readers may wonder whether there are any fundamental reason energy stocks have dropped much less in value since the summer than energy futures prices. Now energy companies are valued much like any other companies: roughly speaking, their stock is worth the present value of their anticipated future cash-flow plus their current net asset value. The current net asset value certainly should follow the front-month crude oil contracts very closely, in fact, more closely than their stock price. However, their anticipated future cash-flow reflects the expected price of oil in the years to come, not the current cash price of oil. (For those readers who enjoy a bit of exercise, they can look up the oil contracts that expire in 2007, 2008 and beyond to see if they in fact has higher prices than the front contract.) At this time, the stock (and futures) market is telling us this: oil price will go back up in the future.


Tuesday, October 03, 2006

How To Advertise

Thank you for your interest in advertising on Quantitative Trading. We have approximately 5000 unique visitors that view 11,000 pages per month. Engage our valuable demographic of highly educated and affluent readers through multiple placement options including premium display, buttons and links, email and newsletters, co-registration and lead generation, sponsorships, home page takeovers and other creative advertising solutions.
Available Ad Sizes: 728x90, 300x250, 160x600, and 88x31.
InvestingChannel is one of the fastest growing financial media companies and is our exclusive advertising partner. With InvestingChannel’s seasoned team of professionals, you can optimize your campaigns to maximize return on investment with the highest level of service.
To learn more about advertising on Quantitative Trading contact InvestingChannel at:
(p)  (646) 545-2850
(f)   (646) 545-2849
www.investingchannel.com


Monday, October 02, 2006

A “Highly Improbable” Event?

A historical analysis of the natural gas spread trade that bought down Amaranth

Nick Maouis, the founder of Amaranth, claims that the 6-billion dollar loss that his fund suffers is due to a “highly improbable” event in the natural gas market. Some analysts have thrown doubts on this claim. To see how improbable this loss is, let’s take a quick look at the historical performance of this trade since 2000. This is not only of forensic (and perhaps legal) interest: if Mr. Maouis’ claim were true, it would have furnished us a glimpse of a potentially highly profitable trading strategy.

The bet that Amaranth and its head trader Brian Hunter made is that the March-over-April spread in natural gas futures will increase in value throughout the year prior to the contract expiration. Unfortunately for their investors, the spread decreases rather than increases in September, resulting in a $6 billion drop in value. We don’t know the exact time when Amaranth bought this spread. However, it is likely that they have started buying in April of this year. April is the time when the nation’s natural gas storage inventory coming out of the winter is known and thus provides a foundation to bet on next winter’s natural gas sufficiency. I plotted below the profit-or-loss of buying this spread (long one March contract of the following year, and short one April contract) in April and exiting the position at the end of September every year since 2000. (Click on the graph twice to make it bigger.)








To my surprise, this trade loses money 3 out of 6 previous years. The one year that this trade was very profitable is 2005: it made more than $16,000 profit per pair of contracts. This is consistent with a Wall Street Journal report that Mr. Hunter made $1 billion for Amaranth in 2005. That was indeed due to an improbable event last year: Hurricane Katrina.

Note also from the 2006 graph that, consistent with news reports, the trade was actually quite profitable up till the beginning of September. This paper profit may not be easily realized by Mr. Hunter though, since a lot of it may be due to his aggressively increasing his position and driving up the market.

Now there can be several objections to my analysis. You might think that if we hold on to this spread position longer, say till December, it would have been more profitable historically. My research shows otherwise. Holding till December would have resulted in losing 4 out of the previous 5 years, losing even in 2005. You might also argue that this is an extremely simplistic version of Mr. Hunter’s strategy. No doubt Mr. Hunter used various complex options strategies, continuously adjusted with various fundamental factors such as weather prediction and natural gas inventory reports as inputs. However, from a risk management point of view, the portfolio that Mr. Hunter owns seems highly correlated to a plain vanilla spread position that I described. The fact that this plain vanilla position loses money half the time historically would not have been reassuring.

In a future article, I will describe some calendar spread trades in energy futures that do have a much better profit consistency.