Wednesday, April 25, 2007
Recap: Gasoline futures seasonal trade
Friday, April 20, 2007
Recap: Platinum-gold spread trade

The maximum draw-down experienced in the last 7 years is -$4,860. The average profit is $3,064, the maximum profit is $7,320 and the maxmium loss is -$540.
Monday, April 16, 2007
Out-of-sample test on cointegrating basket of stocks
To demonstrate this, let's break up the dataset over 2 periods: 20010522 - 20030123 and 20030124 - 20070403. In the first in-sample period (with 1,000 data points), we pick our 10 stocks to form the basket, and in the second out-of-sample period we see how well it cointegrates with XLE, and we observe how the spread behaves. I found that in the first period, the t-statistic for cointegration is -3.61934140, indicating the basket cointegrates with over 95% probability. No surprise here. Here is a plot of the spread in this period:

Now, let's find out what happens in the out-of-sample period. Here the t-statistic is just -2.72, whereas the critical value for cointegration at 90% probability is -3.03. So indeed the basket fails to cointegrate at the 90% confidence level. Does that mean our trades will therefore be losing out-of-sample? Not necessarily. Take a look at the behavior of the spread out-of-sample:

Even though it is not nicely symmetric around zero as in the in-sample period, the spread is still clearly bounded around zero. If the basket completely falls out of cointegration with XLE, it will show a random drift away from zero as time goes on.
To show that this is not just good luck based on our specific in-sample period, let's try a longer in-sample period of 1500 days (shorter in-sample period won't work, because we need a minimum of 1,000 data points here to construct a good reliable basket.) Here the cointegration t-statistic is a bit worse, at -2.62. If we look at the spread:

Once again, we see that the spread is bounded, not wandering off to infinity. So in conclusion, I maintain that my method of constructing the basket is good for practical trading, though not necessarily guaranteeing as high a statistical confidence level as might be indicated in the in-sample period.
Saturday, April 07, 2007
Hedging isn't always better
First off, it is a bit silly to work hard to find a market-neutral strategy so that we can have a smaller drawdown so that we can increase its leverage to boost its return. After all these leveraging, the drawdown is often back to the same level as a long-only strategy! Why not just run a long-only strategy at a lower leverage, but that is often simpler in design and that incurs lower transaction costs (since there is only one-side of the trade to execute)?
Secondly, there is a misconception that long-only strategies will surely lose money in bear markets. This is probably true when you are holding overnight -- but long-only day-trading strategies are often profitable in both bull and bear markets.
Thirdly, there are strategies where only the long trades work. A simple example is a strategy that buys an index at its 10-day low, and exit when... well, there are multiple ways to exit and most of them work! If you try the mirror image of this strategy, i.e. short an index at its 10-day high, it works far less well. This simply reflects the positive mean return of the equity market, and why not take advantage of that?
Finally, related to the third point, sometimes the short hedge fails simply because the short instrument is actually quite different in nature than the long one, despite their superficial similarity. An example is provided by Mr. Sandy Fielden at Logical Information Machines. There is a usually profitable trade where you long a May gasoline futures contract and simultaneously short a May heating oil contract in the spring. The logic is that as the weather gets warmer, the driving season will begin which drives the price of gasoline futures up, and the demand for heating will decrease which drives the price of heating oil futures down. This hedged trade is supposed to eliminate general energy market risk. However, the weather is sometimes unpredictable, and in 2005, this trade went quite wrong primarily because the winter lasted longer. On the other hand, if you only enter the long side of this trade, i.e. buy gasoline futures in the spring, it works like a charm every year in the past 10 years! (I have posted a detailed analysis of this long-only gasoline futures trade in my Premium Content area.)
Therefore, if you trade for yourself and not for some institutions with a mandate only for market-neutral strategies, there is no need to be bounded by the same rules that they have to play by.
Saturday, March 24, 2007
Seven factors that capture most of hedge funds' returns
1) excess return on the S&P 500 index;
2) a small minus big factor constructed as the difference of the Wilshire small and large
capitalization stock indices;
3) excess returns on portfolios of lookback straddle options on currencies;
4) excess returns on portfolios of lookback straddle options on commodities;
5) excess returns on portfolios of lookback straddle options on bonds;
6) the yield spread of the US ten year treasury bond over the three month T-bill, adjusted for the duration of the ten year bond;
7) the change in the credit spread of the Moody's BAA bond over the 10 year treasury bond, also appropriately adjusted for duration.
According to the researchers, factors 3)-5) are constructed to replicate the maximum possible return to trend-following strategies on their respective underlying assets.
See, it is not that difficult to run a hedge fund after all!
Sunday, March 18, 2007
Is increasing beta or increasing leverage a better way to increase returns?
Mr. Goldstein also made another very interesting observation. He noted that there are usually 2 ways to increase the returns of a portfolio of stocks: either by picking high-beta stocks, or by increasing the leverage of the portfolio. In both cases, we are taking on more risk in order to generate more returns. But are these 2 ways equal? Or is one better than the other? It turns out that there is some research out there which suggests increasing leverage is the better way, due to the fact that the market seems to be chronically under-pricing high-beta stocks. This gives rise to a strategy called "Beta Arbitrage": buy low-beta stocks, short high-beta stocks, and earn a positive return.
I myself have not studied this form of arbitrage in depth, and therefore can neither endorse nor criticize it. However, if this research is correct, it does argue against including too many volatile stocks in your portfolio or trading strategy. If you want to take on more risk and generate higher return, just turn the knob and increase your leverage and therefore book size.
Sunday, March 04, 2007
Maximizing Compound Rate of Return vs Maximizing Sharpe ratio
Mr. Goldstein also suggested a beta arbitrage strategy which he has allowed me to share with my readers in a future post.
Tuesday, February 27, 2007
Platinum-gold spread revisited
Saturday, February 24, 2007
Index arbitrage with XLE
XLE is composed of some 33 stocks (as of 2/16/2007). Our goal is to pick some smaller subset of these stocks to form a basket. We pick them based on how well they cointegrate with XLE. How big should this subset be? The higher the number, the better this basket cointegrates with XLE, but the smaller the profits. (If you include all stocks in XLE in this basket, then the basket cointegrates perfectly with XLE, but there will be no trading opportunities!) The lower the number, the higher the (specific) risk as well as return. So it is more of a personal risk-return preference than any scientific criterion which determines how many stocks to pick. I pick a basket with 10 stocks. I have found that this basket cointegrates with XLE with better than 99% probability since 2001/05/22. The half-life for mean-reversion is about 20 days, which means you have to hold a position for at most a quarter. (My own rule is to exit when the spread hasn't reverted in 3 times the half-life.) If you enter into a position when the z-score is about ±2, you can expect a profit of about $2,000 on an investment of about $58,000 on one side. This comes to a return per trade of about 3%. You can of course boost this return by using options to implement the XLE position instead.
As an aside, if you use Interactive Brokers, you can easily trade an entire basket of stocks using their Basket Trader.
I have created an online spreadsheet with (almost) real-time values of this spread in the subscription area. (The detailed composition of this basket of 10 stocks are also described there.) Note that in theory, every time the XLE changes composition, we will have to re-compute our basket composition as well. But fortunately XLE composition does not change very much or very often, so I will only update my basket at most once a month.

Thursday, February 15, 2007
Do Gold and Oil Cointegrate?
I did a cointegration analysis between gold and oil prices, and though their spread certainly looks somewhat mean-reverting since the 90's, it doesn't pass the cointegration test. The reason may simply be that this spread mean-reverts at a glacial pace: I estimate that the half-life (see my explanation of this term here) is over 14 months. Therefore, it may require historical data back to the 1970's to convince ourselves of their cointegration. (My own data on crude oil and gold prices only go as far back as the 1990's. If any reader knows of historical data source that goes back further, please let me know.) If, however, one is willing to take their cointegration by faith despite the inadequate data, then one may believe that gold is currently (as of Feb 12, 2007) just slightly undervalued relative to oil (the spread is about $8). I certainly don't recommend entering into a position on either side at this point!

Wednesday, February 14, 2007
Another article on political futures markets
Monday, February 12, 2007
Use the right discount rate to avoid jail time
Saturday, February 10, 2007
In praise of day-trading
To evaluate whether a strategy has failed bears a lot of resemblance to evaluating whether a particular trade has failed. In my previous article on stop-loss, I outlined a method to determine how long it takes before we should exit a losing trade. This has to do with the historical average holding period of similar trades. This kind of thinking can also be applied to a strategy as a whole. If your strategy, like the Value Line system, holds a position for months or even years before replacing it with others, then yes, it may take many years to find out if the system has finally stopped working. On the other hand, if your system holds a position for just hours, or maybe just minutes, then no, it takes only a few months to find out! Why? Those who are well-versed in statistics know that the larger the sample size (in this case, the number of trades), the smaller the percent deviation from the mean return.
Which brings me to day-trading. In the popular press, day-trading has been given a bad-name. Everyone seems to think that those people who sit in sordid offices buying and selling stocks every minute and never holding over-night positions are no better than gamblers. And we all know how gamblers end up, right? Let me tell you a little secret: in my years working for hedge funds and prop-trading groups in investment banks, I have seen all kinds of trading strategies. In 100% of the cases, traders who have achieved spectacularly high Sharpe ratio (like 6 or higher), with minimal drawdown, are day-traders.
Monday, February 05, 2007
Index tracking, arbitrage, and cointegration
Sunday, February 04, 2007
Cointegration between oil and bond yield? Not!
My curiosity piqued, I proceeded to get a longer history of these data to examine.
In the graph above, I plotted the (normalized) difference between the 10-year treasury yield and oil price. One can see that over the last year and a half, they are indeed cointegrated to a good degree. (To see that, notice the spread is range-bound, or mean-reverting, from mid-2005 to the present.) But this relationship breaks down completely over the longer history.Though I think that the Economist magazine is doing a disservice to its readers for plotting this graph over just one year and making innuendos of linkage, it is a nice illustration of the danger of studying cointegration over a short window.
Sunday, January 28, 2007
Stop-loss strategy: re-post
So here is the permanent link again.
Monday, January 15, 2007
What is your stop loss strategy?
A reader recently asked me whether setting a stop loss for a trading strategy is a good idea. I am a big fan of setting stop loss, but there are certainly myriad views on this.
One of my former bosses didn't believe in stop loss: his argument is that the market does not care about your personal entry price, so your stop price may be somebody else’s entry point. So stop loss, to him, is irrational. Since he is running a portfolio with hundreds of positions, he doesn’t regard preserving capital in just one or a few specific positions to be important. Of course, if you are an individual trader with fewer than a hundred positions, preservation of capital becomes a lot more important, and so does stop loss.
Even if you are highly diversified and preservation of capital in specific positions is not important, are there situations where stop loss is rational? I certainly think that applies to trend-following strategies. Whenever you incur a big loss when you have a trend-following position, it ususally means that the latest entry signal is opposite to your original entry signal. In this case, better admit your mistake, close your position, and maybe even enter into the opposite side. (Sometimes I wish our politicians think this way.) On the other hand, if you employ a mean-reverting strategy, and instead of reverting, the market sticks to its original direction and causes you to lose money, does it mean you are wrong? Not necessarily: you could simply be too early. Indeed, many traders in this case will double up their position, since the latest entry signal in this case is in the same direction as the original one. This raises a question though: if incurring a big loss is not a good enough reason to surrender to the market, how would you ever decide if your mean-reverting model is wrong? Here I propose a stop loss criterion that looks at another dimension: time.
The simplest model one can apply to a mean-reverting process is the Ornstein-Uhlenbeck formula. As a concrete example, I will apply this model to the commodity ETF spreads I discussed before that I believe are mean-reverting (XLE-CL, GDX-GLD, EEM-IGE, and EWC-IGE). It is a simple model that says the next change in the spread is opposite in sign to the deviation of the spread from its long-term mean, with a magnitude that is proportional to the deviation. In our case, this proportionality constant θ can be estimated from a linear regression of the daily change of the spread versus the spread itself. Most importantly for us, if we solve this equation, we will find that the deviation from the mean exhibits an exponential decay towards zero, with the half-life of the decay equals ln(2)/θ. This half-life is an important number: it gives us an estimate of how long we should expect the spread to remain far from zero. If we enter into a mean-reverting position, and 3 or 4 half-life’s later the spread still has not reverted to zero, we have reason to believe that maybe the regime has changed, and our mean-reverting model may not be valid anymore (or at least, the spread may have acquired a new long-term mean.)
Let’s now apply this formula to our spreads and see what their half-life’s are. Fitting the daily change in spreads to the spread itself gives us:
These numbers do confirm my experience that the GDX-GLD spread is the best one for traders, as it reverts the fastest, while the XLE-CL spread is the most trying. If we arbitrarily decide that we will exit a spread once we have held it for 3 times the half-life, we have to hold the XLE-CL spread almost a calendar year before giving up. (Note that the half-life count only trading days.) And indeed, while I have entered and exited (profitably) the GDX-GLD spread several times since last summer, I am holding the XLE - QM (substituting QM for CL) spread for the 104th day!