Thursday, June 28, 2007

Fair value of currencies

In the same issue of the Economist magazine I cited previously, there is an article about the valuation of currencies based on 13 quantitative models that Morgan Stanley developed. They found that the most overvalued currency (against the US dollar) is the New Zealand dollar, while the most undervalued currency is the Japanese Yen.

What about the Chinese Yuan that arouses much hoopla in Congress? The models found it to be almost exactly fairly valued.

Wednesday, June 27, 2007

News-driven algorithmic trading

There is an article about algorithmic trading in the latest issue of the Economist magazine, where it says that one-third of all stock trades in the US are due to algorithmic trading. This should not surprise us. What is more interesting is its mention of the electronically tagged news products that are coming out of Dow Jones and Reuters, which purportedly enable computers to buy or sell stocks immediately upon the release of a news item. The data suppliers regard these news products as some kind of secret high-tech weapons: "Dow Jones claims the business is so secretive that it cannot divulge details of customers." Is this hype justified?

Actually, to get a taste of news-driven trading, you don't need to pay a hefty fee to buy one of these products. You can just monitor the regularly scheduled economic news release (consumer confidence, new homes sales, crude inventories, etc.), trade the relevant futures, and proceed to make millions.

The fact that most of us who monitor these economic news releases haven't yet made our millions is an indication whether these news products will help you do the same. The information contained in the news is often difficult to interpret. Even the initial price reaction to the news may be wrong, leading to swift reversal after an apparent initial trend. And finally, what's wrong with scanning for sudden price movemenets, and then check for possible news to confirm that the price movement is due to the release of new information?

Friday, June 22, 2007

Pair trading stocks and the life-cycle of strategies

I have discussed in various articles trading the spreads between pairs of ETF’s, or between a basket of stocks against an ETF using cointegration technique. There is, however, a glaring omission, as I haven’t yet mentioned the classic statistical arbitrage strategy: pair-trading stocks.

There are pros and cons on applying cointegration to pair-trading stocks. On the pro side: because of the large number of stocks, we can enjoy a highly diversified portfolio that improves the validity of our results. Even if a number of spreads fail to cointegrate going forward, we can count on a larger number of spreads that still do. (For e.g. my USO-XLE spread fell apart, while GLD-GDX spread is still tightly cointegrated.) There are 2 main cons: 1) stocks are subject to various specific risks which may render our purely statistical model useless, especially in M&A situations. Therefore it is customary to remove such stocks from our portfolio when they are involved in special situations – however, by the time the news is public we may have incurred substantial loss already; also 2) because of the technique’s long history, it became known to many hedge funds and indeed students of finance, and therefore pair trading stocks has not been very profitable, especially in the period 2003-2005. Here I plotted the excess returns of the strategy as applied to US bank stocks from 20010102-20041231. (Excess returns means credit interest on margin balance is not included.)

Interestingly, when a strategy becomes too popular and less profitable, many traders start to abandon it, or at least reduce their trading capital invested in the strategy. After a while, its popularity decreases, and the profitability recovers! This life-cycle of strategies reveals itself as mean-reversion of strategies, on top of mean-reversion of stock prices. In our case, this strategy recovery starts in 2005, and is still in full-force. Here I plotted the excess returns of the strategy as applied to US bank stocks from 20050103 to 20070531:


The average annual excess return in 2005-now is about 7.7% (on one-side of capital), and the Sharpe ratio is 0.8. Since I have applied the technique on only one industry group, diversification is limited and therefore the Sharpe ratio is low. For the interested readers, they can attempt to apply this technique to more industry groups and perhaps generate a higher Sharpe ratio. Even with just one industry group, this trading strategy may be a good complement to a portfolio heavy on trend-following strategies and therefore require a reversal model to smooth out the returns.

I have started a model portfolio in my subscription area to demonstrate this strategy which will be updated daily around 3pm ET. Other details of the strategy will be detailed in an accompanying article there as well.


The effect of terrorism on forex trading

Here is an interesting and thoughtful article, with reference to an academic study, on how terrorism affects forex trading.

Tuesday, June 12, 2007

A factor model that I can believe in

Some of you may remember that I preached about the uselessness of factor models in predicting short term return, and the unreliability of many exotic factors even for the long term. In particular, factor models are especially inaccurate in valuing growth stocks (i.e. stocks with low book-to-market ratio), as evidenced by such models' poor performance during the internet bubble. This is not surprising because most commonly used factors rely on historical sales or earnings measures to judge companies, while many growth stocks have very short history and little or no earnings to report. However, as pointed out recently by Barry Rehfeld in the New York Times, Professor Mohanram of Columbia University has devised a simple factor model that rely on 8 very convincing factors to score growth stocks. These factors are:

  1. Normalized return on assets.
  2. Normalized return on assets based on cash flow.
  3. Cash flow minus net income. (i.e. negative of accrual.)
  4. Normalized earnings variability.
  5. Normalized sale growth variability.
  6. Normalized R&D expenses.
  7. Normalized capital spending.
  8. Normalized advertising expenses.
By "normalized", I mean we need to standardize the numbers with respect to the industry median. To Prof. Mohanram's credit, he claims only that these factors will generate returns after 1 or 2 years, not the short-term returns that many traders expect factor models to deliver. The excess annual return based on buying the group of stocks with the highest score and shorting the group with the lowest score is a good 21.4%. Not only does the combined score generate good returns, but each individual factor also delivers good correlation with future returns, proving that the performance is not due to some questionable alchemy of mixing the factors. For example, it makes good intuitive sense that extra spending on R&D and advertising will boost future earnings for growth stocks.

Interestingly, Prof. Mohanram pointed out that most of the out-performance of the high-score stocks occur around earnings announcements. Hence for those investors who don't like holding a long-short portfolio for a full year, they can just trade during earnings season.

One caveat of this research is that it was based on 1979-99 data (at least for the preprint version that I read). As many traders have found out, strategies that work spectacularly in the 90's don't necessarily work in the last few years. At the very least, the returns are usually greatly diminished. In the future, I hope to perform my own research to see whether this strategy is still holding up with the latest data.

Monday, May 14, 2007

Platinum vs. Gold

The Economist magazine has given us a fundamental reason to buy platinum (if not to short gold), in addition to my seasonal one.

Saturday, May 05, 2007

Recap: Australian dollar futures seasonal trade

Yesterday was the exit of the Australian dollar futures seasonal trade which I discussed in my premium content. It incurred a loss of $920 per contract, despite a 12-year winning streak previously. This may be the peril of a trade that is not based on any fundamental rationale that I know of, as well as an in-sample bias that I alluded to in my previous article. I will keep it on my watchlist for another year.

By the way, due to a technical glitch, my previous article on seasonality in commodities futures was not sent to many subscribers, so here is the link.

Wednesday, May 02, 2007

Are claims of seasonality in commodity futures markets "fraudulent "?

I have written about several commodities futures seasonal trades (e.g. PL-GC here, and RT here) recently, and while I was researching another such trade I came upon this webpage from the Commodity Futures Trading Commission. It says, in no uncertain terms,

" The Commodity Futures Trading Commission (CFTC) warns consumers to be alert to possible fraudulent claims that they can profit on commodity futures or options trading as a result of changes in the prices of physical commodities based on seasonal weather patterns or other well-known events."

It goes on to say that

"Futures and options markets adjust very quickly to news events and announcements, and by the time salesmen come calling, the opportunity to profit from such news is gone."

Whoa, this certainly got my attention! Since I am not a journalist, I don't normally go around challenging claims made by the United States government. But if this statement, which is basically the efficient market hypothesis, is generally true, then all of us traders should just pack up and go home. Now whether or not the efficient market hypothesis is true is subject to much academic debate. But is it right for the government to state definitively that this hypothesis is true, and that all claims otherwise are "fraudulent"?

Political arguments aside, I think that the commodities market may have more arbitrage opportunities (i.e. less efficient) than the stock market. Perhaps this is because there are more participants in the commodities markets that are not speculators, particularly for "consumption" commodities such as oil and gas.

This is not to say that every seasonal pattern that we have backtested is necessarily going to repeat itself. Many of these patterns occur only once a year, and there are just so many years that we can use for our backtest, and needless to say, most of them are "in-sample". My practice is to paper-trade the pattern for at least one year going forward as an "out-of-sample" test, especially if the pattern is not supported by a strong fundamental rationale (like the Australian dollar trade that I talked about in my premium content area.) Furthermore, by publishing my backtest results on this blog, any future repeat of the pattern can indeed be regarded as out-of-sample, increasing our confidence in them.

My own interest in researching seasonality in commodities market was (hopefully) not piqued by the kind of snake-oil salesman that CFTC warns us about. About a year or so ago, I attended a talk given by Dr. David Eliezer at Columbia University's Financial Engineering seminar. The topic is "Structure and Behavior of Commodities Markets" in which he outlined various seasonal patterns that persist in the futures markets. Dr. Eliezer was formerly the chief quantitative researcher at Goldman Sachs' commodities group. Given this academic respectability, I certainly feel emboldened to enter into the debate!

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.

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.

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.

Saturday, March 24, 2007

Seven factors that capture most of hedge funds' returns

The Economist magazine just published an article that talked about "synthetic" hedge funds, or replicating hedge fund returns using factor models. The original research cited can be found here. (For those of you who want a primer on factor models, I have written an article on this topic previously.) The seven factors are (are you ready?):

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?

In my previous post, I reported an astute observation from my reader Mr. Goldstein that maximizing compound rate of return, maximizing leverage, and maximizing Sharpe ratio are all tightly connected. This makes intuitive sense because the higher the Sharpe ratio of a strategy, the smaller the drawdown, and therefore the higher the leverage you can apply to it in order to maximize compound return.

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

A reader, Mr. A. Goldstein, made a very useful observation about my article "Maximizing Compound Rate of Return". In that article I argued that if your goal is to maximize the compound rate of return, you should maximize the quantity m – s2/2, where m is the short-term (1-period) rate of return, and s is its standard deviation. In general, this is not the same as maximizing the Sharpe ratio of a strategy. However, Mr. Goldstein pointed out that, if you also optimize the leverage of your strategy using Kelly's criterion, then maximizing Sharpe ratio does in fact maximize the compound rate of return also. This follows from a calculation in section 7 of Dr. Edward Thorpe's paper www.bjmath.com/bjmath/thorp/paper.htm.

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

Now that Chinese New Year is over, it is time to revisit the Platinum-Gold spread that I talked about last November. The theory is that with the demand for gold seasonally exhausted due to the end of Asian festivities, gold prices will decline relative to platinum. We now have the opportunity to test this theory again.

Saturday, February 24, 2007

Index arbitrage with XLE

In looking for pairs of financial instruments to pair trade, we do not have to limit ourselves to pairs that occur in "nature". We can often construct our own baskets of stocks to trade against an index (or an ETF representing this index). In fact, such pairs usually show better cointegration properties than any stock or ETF pairs. I have alluded to this index arbitrage idea in an earlier post, and the details of the methodology are explained in my articles for Subscribers. I tried this strategy on favorite sector ETF: the energy SPDR 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 have written extensively here about cointegration between gold-miners and gold ETF's (GDX vs GLD), as well as between energy companies and oil ETF's (XLE vs USO). (See, for e.g., this article, or this article.) On another occasion, I also commented on an Economist magazine article about the possible cointegration between bond yield and oil prices. However, my fellow blogger Yaser recently pointed out an interesting link between gold and oil also. The reasons why gold and oil may be cointegrated are very similar to that of bond yield and oil: as oil price rise a) the oil revenue is invested heavily in gold, therefore pushing up gold price; b) there is an upward pressure on inflation, which increases the appeal of gold as an inflation hedge.

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

A NYTimes article yesterday talked about the political futures market intrade.com in the context of the November election, particularly the Virginia Senate race, which I blogged about before. I urged my readers to curb their enthusiasm for using such markets for prediction in my article, while the NYTimes article is certainly much more enamored of them. However, I think we can all agree that such markets are very efficient in synthesizing all existing information and opinion in making a prediction, but it cannot reveal information that nobody can possibly know at this point, such as who is going to win the 2008 general election.

Monday, February 12, 2007

Use the right discount rate to avoid jail time

Here is a fascinating story about the former treasurer of Essex County, New Jersey, who was sentenced to seven and a half years in prison because the prosecutor used the wrong discount rate to value certain tax-exempt bonds.