Wednesday, April 25, 2007
Recap: Gasoline futures seasonal trade
The gasoline futures seasonal trade that I mentioned in a previous post and discussed in details in my premium content area reached its exit today. It has been profitable for at least 11th consecutive years: the profit this year is $4,321.80 per contract of RT.
Friday, April 20, 2007
Recap: Platinum-gold spread trade
The platinum-gold spread trade that I discussed is once again profitable this year. If a trader entered the positions near the close on February 26 and exited the positions near the close on April 19, the profit would have been about $6,610 this time. However, I did made a calculation mistake when I plotted the historical profit graphs before. So here it is again:
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.
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
An anonymous reader "L" posted some thoughtful objections to the way I constructed the basket of stocks that is supposed to cointegrate with XLE. His main objection is that even though my basket shows cointegration with XLE in-sample, this is likely to fail out-of-sample. Actually, I agree with him that the strong statistical relationship discovered in-sample is most likely going to be weakened out-of-sample, most often because the nature of the component stocks is always changing, due to various corporate events (management change, restructuring, change of strategic direction, etc.). However, from a practical trading point of view, I believe that the relationship should not be weakened to the point that the trading signals become spurious, at least over a time-scale of a trade which is several months to half-a-year at most.
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.
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
Many of the strategies I wrote about in this blog are market-neutral strategies: long one instrument and short another one as a hedge. In many hedge funds, these are the only strategies that are allowed: investors imagine that only market-neutral hedge funds can deliver consistent returns in bull and bear markets alike, and the typically smaller drawdowns experienced by such funds allow them to obtain higher leverage from their prime brokerages. However, over the years I have become convinced that this bias in favor of market neutral strategies is misplaced in several ways.
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.
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.