I confess I have always found it hard to trade options. This is despite having read some of the "bibles" of options trading, including Lawrence McMillan's Options as a Strategic Investment and Euan Sinclair's Option Trading: Pricing and Volatility Strategies and Techniques. Partly that is because I prefer simple strategies, and options strategies are rarely simple. Partly that is because I was brought up on stocks, but stock options are depressingly illiquid. Most successful options traders that I know of prefer to trade index options instead, an area that I unfortunately have no intuition at all. Papers and books written by options professionals on this topic tend to be dense with equations, and worse, they seldom focus on the practical side of trading.
That's why I am pleased to learn that Larry Connors, whose books I enjoy due to their simplicity of exposition, is presenting his first ever quantitative index options trading seminars. Interested traders can register for his free preview webinars on August 9 and 15 here, or a pre-recorded preview here.
===
Speaking of seminars, readers in Asia may be interested to know that my own workshops on Backtesting and Statistical Arbitrage will be held in Hong Kong on October 2-5. The same workshops will be held in London on November 19-22.
(I enjoy giving those workshops very much, because many of the participants are institutional traders whose knowledge and points of view are very much at the cutting edge. Past participants include quants and traders from, in no particular order, Goldman Sachs, Morgan Stanley, Royal Bank of Scotland, Bank of America, UBS, Societe Generale, Deutsche Bank, BNP Paribas, JP Morgan, Barclays, Citigroup, Blackrock, and various other Asian and European hedge funds, energy companies, banks, and asset managers. I humbly submit that the in-class discussions are sometimes more interesting than my prepared materials.)
===
I wrote some time ago about those FX brokers or ECNs where algo-traders can colocate their trading programs to lower latency for a reasonable price. There are also similar options for futures algo-traders. For e.g. Optimus Trading Group provides a market data service called Rithmic which is colocated at the major futures exchanges, and traders can colocate with Rithmic to reduce latency. Of course, traders can also directly colocate at the new CME data center in Aurora, IL. I suspect, though, that the cost of the latter option will be considerable.
====
Finally, as a quant trader, I nevertheless read macroeconomic analyses occasionally, if only to figure out why some of my strategies suddenly start to fail. One website that provides interesting analysis of the energy markets is oilprice.com. In particularly, this interview with economic commentator Mike Shedlock is unusually detailed and thoughtful.
Saturday, August 04, 2012
Tuesday, July 10, 2012
Extracting roll returns from futures
Futures returns consist of two components: the returns of the spot price and the "roll returns". This is kind of obvious if you think about it: suppose the spot price remains constant in time (and therefore has zero return). Futures with different maturities will still have different prices at any point in time, and yet they must all converge to the same spot price at expirations, which means they must have non-zero returns during their lifetimes. This roll return is in action every day, not just during the rollover to the next nearest contract. For some futures, the magnitude of this roll return can be very large: it averages about -50% annualized for VX, the volatility futures. Wouldn't it be nice if we can somehow extract this return?
In theory, extracting this return should be easy: if a future is in backwardation (positive roll return), just buy the future and short the underlying asset, and vice versa if it is in contango. Unfortunately, shorting, or even buying, an underlying asset is not easy. Except for precious metals, most commodity ETFs that hold "commodities" actually hold only their futures (e.g. USO, UNG, ...), so they are of no help at all in this arbitrage strategy. Meanwhile, it is also a bit inconvenient for us to go out and buy a few oil tankers ourselves.
But in arbitrage trading, we often do not need an exact arbitrage relationship: a statistical likely relationship is good enough. So instead of using a commodity ETF as a hedge against the future, we can use a commodity-producer ETF. For example, instead of using USO as a hedge, we can use XLE, the energy sector ETF that holds energy producing companies. These ETFs should have a higher degree of correlation with the spot price than do the futures, and therefore very suitable as hedges. In cases where the futures do not track commodities (as in the case of VX), however, we have to look harder to find the proper hedge.
Which brings me to this fresh-off-the-press paper by David Simon and Jim Campasano. (Hat tip: Simon T.) This paper suggests a trading strategy that tries to extract the very juicy roll returns of VX. The hedge they suggest is -- you guessed it! -- the ES future. In a nutshell: if VX is in contango (which is most of the time), just short both VX and ES, and vice versa if VX is in backwardation.
Why does ES work as a good hedge? Of course, its very negative correlation with VX is the major factor. But one should not overlook the fact that ES also has a very small roll return (about +1.5% annualized). In other words, if you want to find a future to act as a hedge, look for ones that have an insignificant roll return. (Of course, if we can find a future that has high correlation with your original future but which has a high roll return of the opposite sign, that would be ideal. But we are seldom that lucky.)
P.S. The reader Simon who referred me to this paper also drew my attention to an apparent contradiction between its conclusion and my earlier blog post: Shorting the VIX Calendar Spread. This paper says that it is profitable to short VX when it is in contango and hedge with short ES, while I said it may not be profitable to short the front contract of VX when it is in contango and hedge with long back contract of VX. Both statements are true: hedging with the back contract of VX brings very little benefit because both the front and back contracts are suffering from very similar roll returns, so there is little return left when you take opposite positions in them!
In theory, extracting this return should be easy: if a future is in backwardation (positive roll return), just buy the future and short the underlying asset, and vice versa if it is in contango. Unfortunately, shorting, or even buying, an underlying asset is not easy. Except for precious metals, most commodity ETFs that hold "commodities" actually hold only their futures (e.g. USO, UNG, ...), so they are of no help at all in this arbitrage strategy. Meanwhile, it is also a bit inconvenient for us to go out and buy a few oil tankers ourselves.
But in arbitrage trading, we often do not need an exact arbitrage relationship: a statistical likely relationship is good enough. So instead of using a commodity ETF as a hedge against the future, we can use a commodity-producer ETF. For example, instead of using USO as a hedge, we can use XLE, the energy sector ETF that holds energy producing companies. These ETFs should have a higher degree of correlation with the spot price than do the futures, and therefore very suitable as hedges. In cases where the futures do not track commodities (as in the case of VX), however, we have to look harder to find the proper hedge.
Which brings me to this fresh-off-the-press paper by David Simon and Jim Campasano. (Hat tip: Simon T.) This paper suggests a trading strategy that tries to extract the very juicy roll returns of VX. The hedge they suggest is -- you guessed it! -- the ES future. In a nutshell: if VX is in contango (which is most of the time), just short both VX and ES, and vice versa if VX is in backwardation.
Why does ES work as a good hedge? Of course, its very negative correlation with VX is the major factor. But one should not overlook the fact that ES also has a very small roll return (about +1.5% annualized). In other words, if you want to find a future to act as a hedge, look for ones that have an insignificant roll return. (Of course, if we can find a future that has high correlation with your original future but which has a high roll return of the opposite sign, that would be ideal. But we are seldom that lucky.)
P.S. The reader Simon who referred me to this paper also drew my attention to an apparent contradiction between its conclusion and my earlier blog post: Shorting the VIX Calendar Spread. This paper says that it is profitable to short VX when it is in contango and hedge with short ES, while I said it may not be profitable to short the front contract of VX when it is in contango and hedge with long back contract of VX. Both statements are true: hedging with the back contract of VX brings very little benefit because both the front and back contracts are suffering from very similar roll returns, so there is little return left when you take opposite positions in them!
Tuesday, June 19, 2012
Momentum strategies: a book review
As a devout mean-reversion trader, I find Mike Dever's new book "Jackass Investing" unexpectedly well-argued and readable.
You see, momentum and mean-reversion traders live in two separate universes, and they are often mutually incomprehensible to each other. Dever, as a CTA, inhabits the momentum universe. Example: my favorite performance measure, the Sharpe ratio, has been brusquely dispatched as a bad measurement of risk, and drawdown becomes king. But all for good reasons: Dever argues that Sharpe ratio measures only the daily volatility of returns, but disregarded the "black swan" events, which are much better captured by the maximum drawdown. I agree with the author on this point, but there are other uses of Sharpe ratio: a high Sharpe ratio strategy does indicate high statistical significance of the trading strategy, a claim that momentum strategies can seldom make. I often think of momentum strategies as being long options: you have to keep paying premium until one day, you make them all back with a home run. But when you are backtesting a strategy, how would you know that the rare, statistically insignificant, home run was not due to data snooping bias? Unless of course, like the author, you have fundamental insights into the traded instruments.
Fundamental insights are in fact one of the delicious highlights of this book. Dever describes his orange juice futures strategy using the "marginal cost of production" as a fundamental valuation tool. He argues that orange juice cannot be sold below this cost, since farmers would have no incentive for production otherwise. And he was right: orange juice futures started to rebound from the 27-year low of 55 cents/pound in May 2004, to almost 90 cents/pound in September (thanks partly to hurricanes hitting Florida). Dever went long at 70 cents. Oh, how we quantitative traders would love to have the confidence that such insights inspire!
Of course, I don't agree with everything written in the book. For example, though the author rightly pointed out that the distribution of returns often have a positive kurtosis, he uses that as evidence of trending behavior. While I agree that price trends can indeed produce positive kurtosis, we can certainly construct mean-reverting price series with occasional catastrophes that have the same kurtosis. To us mean-reversion traders, positive kurtosis is not an invitation to "follow-the-trend", but as a warning sign to find risk management measures that protect us from catastrophes.
Even though momentum strategies in general are in a state of trauma right now (more on that later), Dever nevertheless makes a good case why we should include them as part of our portfolio of strategies. Comparing the S&P500 index (SPX) with the S&P Diversifed Trends Indicator (DTI, a simple trend-following strategies on 24 futures), he finds that the Sharpe ratio (though of course he refuses to use that hated term) of the DTI is more than double that of the SPX, with only about 1/3 of the maximum drawdown. But before you, the reader, decides to join the momentum bandwagon, I invite you to take a look at a plot of DTI's values since inception:
Since its high watermark in 2008/12/5, this representative momentum strategy has been in a relentless drawdown. Why? This is due to another well-studied and troubling property of momentum strategies: they always performed poorly for several years after a financial crisis.
You see, momentum and mean-reversion traders live in two separate universes, and they are often mutually incomprehensible to each other. Dever, as a CTA, inhabits the momentum universe. Example: my favorite performance measure, the Sharpe ratio, has been brusquely dispatched as a bad measurement of risk, and drawdown becomes king. But all for good reasons: Dever argues that Sharpe ratio measures only the daily volatility of returns, but disregarded the "black swan" events, which are much better captured by the maximum drawdown. I agree with the author on this point, but there are other uses of Sharpe ratio: a high Sharpe ratio strategy does indicate high statistical significance of the trading strategy, a claim that momentum strategies can seldom make. I often think of momentum strategies as being long options: you have to keep paying premium until one day, you make them all back with a home run. But when you are backtesting a strategy, how would you know that the rare, statistically insignificant, home run was not due to data snooping bias? Unless of course, like the author, you have fundamental insights into the traded instruments.
Fundamental insights are in fact one of the delicious highlights of this book. Dever describes his orange juice futures strategy using the "marginal cost of production" as a fundamental valuation tool. He argues that orange juice cannot be sold below this cost, since farmers would have no incentive for production otherwise. And he was right: orange juice futures started to rebound from the 27-year low of 55 cents/pound in May 2004, to almost 90 cents/pound in September (thanks partly to hurricanes hitting Florida). Dever went long at 70 cents. Oh, how we quantitative traders would love to have the confidence that such insights inspire!
Of course, I don't agree with everything written in the book. For example, though the author rightly pointed out that the distribution of returns often have a positive kurtosis, he uses that as evidence of trending behavior. While I agree that price trends can indeed produce positive kurtosis, we can certainly construct mean-reverting price series with occasional catastrophes that have the same kurtosis. To us mean-reversion traders, positive kurtosis is not an invitation to "follow-the-trend", but as a warning sign to find risk management measures that protect us from catastrophes.
Even though momentum strategies in general are in a state of trauma right now (more on that later), Dever nevertheless makes a good case why we should include them as part of our portfolio of strategies. Comparing the S&P500 index (SPX) with the S&P Diversifed Trends Indicator (DTI, a simple trend-following strategies on 24 futures), he finds that the Sharpe ratio (though of course he refuses to use that hated term) of the DTI is more than double that of the SPX, with only about 1/3 of the maximum drawdown. But before you, the reader, decides to join the momentum bandwagon, I invite you to take a look at a plot of DTI's values since inception:
![]() |
S&P DTI index |
Thursday, April 26, 2012
A few announcements
First, an iPad version of this blog has been launched, so if you are reading this on an iPad, the look will be different. If you want to go back to the old look, just hit Page Turn in the bottom left corner and choose the option there. Any comments or suggestions on this new look are most welcome!
Second, and this is probably irrelevant to most of you reading this blog, a Chinese translation of my book Quantitative Trading is now available.
Third, and most interesting, Larry Connors will be hosting a webinar on "How to Trade High Probability Stock Gaps" on Tuesday, May 1, 2:00pm ET. (Click on link to register.) It is sheer coincidence that I was just writing about stock gaps in my previous post! I have always found Larry's strategies to be clear, concise, and simple - exactly the ingredients for out-of-sample as opposed to in-sample returns!
Friday, April 20, 2012
The life and death of a strategy
Sometimes it is instructive to look back at some strategies that used to thrive, and then quite suddenly contracted a chronic illness that ultimately led to its demise. It gives us a sense of the unreliability of backtests and curb our over-confidence, which is always useful when dealing with the financial markets.
One good example is a well-known strategy that we called "buy-on-gap". In its simplest version, just buy at the open 100 stocks within the S&P500 which have the lowest returns from their previous day's lows to the current day's open, provided that these returns are lower than one standard deviation. (The standard deviation is computed as the 90-day moving standard deviation of close-to-close returns of a stock.) Exit such long positions at the day's close.
Many traders know of variants of this strategy, and I started trading it around the beginning of 2007, and in fact, it formed part of my first fund's portfolio of strategies. You can see the cumulative return chart below (click to enlarge) from 2007/01/03-2008/10/29. The APR is 19%, unlevered. The Sharpe ratio is 1.4 and the maximum drawdown is just 4%. Note that Lehman Brothers went bankrupt on 2008/09/15, and this is a long-only strategy, yet the performance was spectacular in September-October 2008. We were patting ourselves furiously on the back.
Now look what happened after this happy period.
The APR was -6%. 2008/10/29 turned out to be the high watermark.
I have seen some strategies that have the opposite behavior: poor performance prior to 2009, and stellar performance since then. Was there a structural break in the market due to the financial crisis? Was this due to the advent of high frequency trading? The declining volume in the equities market? I will leave these deep questions to financial economists. The only lesson I have learned from this and other examples is that, once a strategy is in decline for some time, it seldom comes back to health, and the best course of action is to bury it swiftly.
One good example is a well-known strategy that we called "buy-on-gap". In its simplest version, just buy at the open 100 stocks within the S&P500 which have the lowest returns from their previous day's lows to the current day's open, provided that these returns are lower than one standard deviation. (The standard deviation is computed as the 90-day moving standard deviation of close-to-close returns of a stock.) Exit such long positions at the day's close.
Many traders know of variants of this strategy, and I started trading it around the beginning of 2007, and in fact, it formed part of my first fund's portfolio of strategies. You can see the cumulative return chart below (click to enlarge) from 2007/01/03-2008/10/29. The APR is 19%, unlevered. The Sharpe ratio is 1.4 and the maximum drawdown is just 4%. Note that Lehman Brothers went bankrupt on 2008/09/15, and this is a long-only strategy, yet the performance was spectacular in September-October 2008. We were patting ourselves furiously on the back.
Now look what happened after this happy period.
The APR was -6%. 2008/10/29 turned out to be the high watermark.
I have seen some strategies that have the opposite behavior: poor performance prior to 2009, and stellar performance since then. Was there a structural break in the market due to the financial crisis? Was this due to the advent of high frequency trading? The declining volume in the equities market? I will leave these deep questions to financial economists. The only lesson I have learned from this and other examples is that, once a strategy is in decline for some time, it seldom comes back to health, and the best course of action is to bury it swiftly.
Friday, March 23, 2012
High-frequency trading in the foreign exchange market
This is the title of a report published by the Bank of International Settlements (which serves central banks around the world) in September 2011. As a Forex trader myself, I of course peruse it with great interest hoping to glimpse whatever is the state-of-the-art. Here are a few interesting nuggets, together with my commentary:
1) FX HFT operate with a latency of less than 1 ms, while most of us mere algorithmic traders typically suffer a latency of at least 10ms. For example, Interactive Brokers does not yet provide collocation facilities for its customers, so the best we can do is to place our trading servers on the internet backbone close to its Stamford, CT, location. The best round-trip ping time is 10ms. Those who trade with FXCM may have a better chance for lower latency, as they provide free collocation to their clients. Those who trade on the ECN FXall can collocate at their Equinix data center, while FCM360 provides collocation service to EBS traders. I cannot find any collocation service for Hotspot FX or Currenex. If you know of such services, or FX brokers who provide collocation, do leave a comment!
2) HFT typically operate in markets with high liquidity and low volatility. The former is not surprising, since markets with low liquidity has few counter-parties to take advantage of. The latter requires a bit of nuance. I think most HFT would benefit from high volatility in a mean-reverting market, but unfortunately high volatility is usually correlated with market in a free fall. So don't be surprised if you find that HFT-provided liquidity suddenly disappears when the market is in stress, though the BIS report stated that they are also quick to re-enter the market once the turmoil is over.
3) As a corollary of 2), HFT mostly trade in the major currency pairs. But increasingly, NZD and MXN have drawn many automated and HF traders.
4) Almost by definition, the bid/ask quotes placed by HFT tend to remain on the book for a very short time, measured in ms, unless forced by the exchange to stay longer. EBS and Reuters both has minimum quote life or minimum fill ratio. One exchange that does not have such minimums is Currenex, which is therefore particularly attractive to HF trading. Hence if you are not a HF player, and do not wish to be taken advantage of by a HF player, be wary of Currenex!
5) Two of the favourite categories of HFT strategies: triangle arbitrage and liquidity-redistribution (taking advantage of pricing discrepancies across different trading platforms.) Despite the bad reputation HFTers have been acquiring in the last few years, I think they do provide a useful service to other algo traders like myself via these 2 strategies. It is a hassle to keep looking for a better broker/prices for your strategy!
1) FX HFT operate with a latency of less than 1 ms, while most of us mere algorithmic traders typically suffer a latency of at least 10ms. For example, Interactive Brokers does not yet provide collocation facilities for its customers, so the best we can do is to place our trading servers on the internet backbone close to its Stamford, CT, location. The best round-trip ping time is 10ms. Those who trade with FXCM may have a better chance for lower latency, as they provide free collocation to their clients. Those who trade on the ECN FXall can collocate at their Equinix data center, while FCM360 provides collocation service to EBS traders. I cannot find any collocation service for Hotspot FX or Currenex. If you know of such services, or FX brokers who provide collocation, do leave a comment!
2) HFT typically operate in markets with high liquidity and low volatility. The former is not surprising, since markets with low liquidity has few counter-parties to take advantage of. The latter requires a bit of nuance. I think most HFT would benefit from high volatility in a mean-reverting market, but unfortunately high volatility is usually correlated with market in a free fall. So don't be surprised if you find that HFT-provided liquidity suddenly disappears when the market is in stress, though the BIS report stated that they are also quick to re-enter the market once the turmoil is over.
3) As a corollary of 2), HFT mostly trade in the major currency pairs. But increasingly, NZD and MXN have drawn many automated and HF traders.
4) Almost by definition, the bid/ask quotes placed by HFT tend to remain on the book for a very short time, measured in ms, unless forced by the exchange to stay longer. EBS and Reuters both has minimum quote life or minimum fill ratio. One exchange that does not have such minimums is Currenex, which is therefore particularly attractive to HF trading. Hence if you are not a HF player, and do not wish to be taken advantage of by a HF player, be wary of Currenex!
5) Two of the favourite categories of HFT strategies: triangle arbitrage and liquidity-redistribution (taking advantage of pricing discrepancies across different trading platforms.) Despite the bad reputation HFTers have been acquiring in the last few years, I think they do provide a useful service to other algo traders like myself via these 2 strategies. It is a hassle to keep looking for a better broker/prices for your strategy!
Saturday, March 03, 2012
Hidden Markov model applied to FX prediction
I read with interest an older paper "Can Markov Switching Models Predict Excess Foreign Exchange Returns?" by Dueker and Neely of the Federal Reserve Bank of St. Louis. I have a fondness for hidden Markov models because of its great success in speech recognition applications, but I confess that I have never been able to create a HMM model that outperforms simple technical indicators. I blame that both on my own lack of creativity as well as the fact that HMM tend to have too many parameters that need to be fitted to historical data, which makes it vulnerable to data snooping bias. Hence I approached this paper with the great hope that experts can teach me how to apply HMM properly to finance.
The objective of the model is simple: to predict the excess return of an exchange rate over an 8-day period. (Excess return in this context is measured by the % change in the exchange rate minus the interest rate differential between the base and quote currencies of the currency pair.) If the expected excess return is higher than a threshold (called "filter" in the paper), then go long. If it is lower than another threshold, go short. Even though the prediction is on a 8-day return, the trading decision is made daily.
The excess return is assumed to have a 3-parameter student-t distribution. The 3 parameters are the mean, the degree of freedom, and the scale. The scale parameter (which controls the variance) can switch between a high and low value based on a Markov model. The degree of freedom (which controls the kurtosis, a.k.a. "thickness of the tails") can also switch between 2 values based on another Markov model. The mean is linearly dependent on the values assumed by the degree of freedom and the scale as well as another Markov variable that switches between 2 values. Hence the mean can assume 8 distinct values. The 3 Markov models are independent. The student-t distribution is more appropriate for the modelling financial returns than normal distribution because of the allowance for heavy tails. The authors also believe that this model captures the switch between periods of high and low volatility, with the consequent change of preference (=different mean returns) for "safe" versus "risky" currencies, a phenomenon well-demonstrated in the period between August 2011 to January 2012.
The parameters of the Markov models and the student-t distributions are estimated in the in-sample period (1974-1981) for each currency pair in order to minimize the cumulative deviation of the excess returns from zero. There are a total of 14 parameters to be so estimated. After these estimations, we have to also estimate the 2 trading thresholds by maximizing the in-sample return of the trading strategy, assuming a transaction costs of 10 basis point per trade.
With this large number (16 in total) of parameters, I dread to see the out-of-sample (1982-2005) results. Amazing, these are far better than I expected: the annualized returns range from 1.1% to 7.5% for 4 major currency pairs. The Sharpe ratios are not as impressive: they range from 0.11 to 0.71. Of course, when researchers report out-of-sample results, one should take that with a grain of salt. If the out-of-sample results weren't good, they wouldn't be reporting them, and they would have kept changing the underlying model until good "out-of-sample" results are obtained! So it is really up to us to implement this model, apply it to data after 2005 and to more currency pairs, to find out if there is really something here. In fact, this is the reason why I prefer to read older papers - to allow for the possibility of true out-of-sample tests immediately.
What do you think can be done to improve this model? I suspect that as a first step, one can see whether the estimated Markov states correspond reasonably to what traders think of as risk-on vs risk-off regimes. If they do, then regardless of the usage of this model as a signal generator, it can at least generate good risk indicators. If not, then maybe the hidden Markov model need to be replaced with a Markov model that is conditioned on observable indicators.
The objective of the model is simple: to predict the excess return of an exchange rate over an 8-day period. (Excess return in this context is measured by the % change in the exchange rate minus the interest rate differential between the base and quote currencies of the currency pair.) If the expected excess return is higher than a threshold (called "filter" in the paper), then go long. If it is lower than another threshold, go short. Even though the prediction is on a 8-day return, the trading decision is made daily.
The excess return is assumed to have a 3-parameter student-t distribution. The 3 parameters are the mean, the degree of freedom, and the scale. The scale parameter (which controls the variance) can switch between a high and low value based on a Markov model. The degree of freedom (which controls the kurtosis, a.k.a. "thickness of the tails") can also switch between 2 values based on another Markov model. The mean is linearly dependent on the values assumed by the degree of freedom and the scale as well as another Markov variable that switches between 2 values. Hence the mean can assume 8 distinct values. The 3 Markov models are independent. The student-t distribution is more appropriate for the modelling financial returns than normal distribution because of the allowance for heavy tails. The authors also believe that this model captures the switch between periods of high and low volatility, with the consequent change of preference (=different mean returns) for "safe" versus "risky" currencies, a phenomenon well-demonstrated in the period between August 2011 to January 2012.
The parameters of the Markov models and the student-t distributions are estimated in the in-sample period (1974-1981) for each currency pair in order to minimize the cumulative deviation of the excess returns from zero. There are a total of 14 parameters to be so estimated. After these estimations, we have to also estimate the 2 trading thresholds by maximizing the in-sample return of the trading strategy, assuming a transaction costs of 10 basis point per trade.
With this large number (16 in total) of parameters, I dread to see the out-of-sample (1982-2005) results. Amazing, these are far better than I expected: the annualized returns range from 1.1% to 7.5% for 4 major currency pairs. The Sharpe ratios are not as impressive: they range from 0.11 to 0.71. Of course, when researchers report out-of-sample results, one should take that with a grain of salt. If the out-of-sample results weren't good, they wouldn't be reporting them, and they would have kept changing the underlying model until good "out-of-sample" results are obtained! So it is really up to us to implement this model, apply it to data after 2005 and to more currency pairs, to find out if there is really something here. In fact, this is the reason why I prefer to read older papers - to allow for the possibility of true out-of-sample tests immediately.
What do you think can be done to improve this model? I suspect that as a first step, one can see whether the estimated Markov states correspond reasonably to what traders think of as risk-on vs risk-off regimes. If they do, then regardless of the usage of this model as a signal generator, it can at least generate good risk indicators. If not, then maybe the hidden Markov model need to be replaced with a Markov model that is conditioned on observable indicators.
Monday, February 13, 2012
Ideas from a psychologist
I have just finished reading Daniel Kahneman's bestseller "Thinking, Fast and Slow", and found it full of inspirations important for traders. This is no surprise, of course, since Kahneman won the 2002 Nobel prize in economics for his work on decision theory. Here are some of the notables:
1) Simple sum is often better than a linear regression fit. Remember my constant mantra that "simpler is better" when building trading models? I have always advocated linear regression over nonlinear models, but Kahneman went a step further. He said that in social science modeling (which of course includes financial markets modeling), assigning equal weights to the predictive factors is often superior to weighting them using multivariate linear regressors when applied to out-of-sample data.
2) Overconfidence in corporate acquisitions. Managers of acquiring companies often believe that they are better than the managers of acquirees. This overconfidence has several causes: there is an illusion of control which overemphasizes the role of skill and neglects the role of luck, and there is a focus on what one knows and a neglect of what one does not, etc. The market already knows this: the stock of the acquirer usually suffers a sell-off upon announcement of the acquisition, because the result of any acquisition is more often bad than good, but the question is whether it has sufficiently discounted this phenomenon. Would shorting the stock of an acquirer at the completion of an acquisition and holding the short position for, say, 5 years, hedging this position with SPY, be profitable?
3) Premortem. After designing a trading strategy, it is always useful to write a brief imaginary history of how it has become an unmitigated financial disaster for you a few years from now. This will likely reveal scenarios that you have not previously thought of, and triggering additional risk management measures.
4) Risk seeking in the face of losses. Suppose you are running a strategy that has a fixed holding period. Have you ever extended this holding period when the position is losing, in the hope that the position will recoup some of its losses? I have, and the result was double the loss I would have suffered had I exited on time. Apparently this is a very common suboptimal behavioral bias: this is why many defendants with a weak legal case often risk continued litigations instead of accepting an unfavorable settlement.
5) Why do we often demand Sharpe ratio >=2? Psychological experiments have shown that people find the pain of losing $1 can only be compensated by the pleasure of winning $2. So if we equate standard deviation as the average drawdown of a strategy, then we need to have twice the average return!
Many businesses have profited from arbitraging the difference between rational decisions and biased decisions that people commonly made. (For e.g. lottery franchises benefit from people overweighting the probability of winning, sellers of extended warranties benefit from buyers' risk-aversion.) I wonder if there are still opportunities left for rational traders to take advantage of the biased decisions of irrational traders?
1) Simple sum is often better than a linear regression fit. Remember my constant mantra that "simpler is better" when building trading models? I have always advocated linear regression over nonlinear models, but Kahneman went a step further. He said that in social science modeling (which of course includes financial markets modeling), assigning equal weights to the predictive factors is often superior to weighting them using multivariate linear regressors when applied to out-of-sample data.
2) Overconfidence in corporate acquisitions. Managers of acquiring companies often believe that they are better than the managers of acquirees. This overconfidence has several causes: there is an illusion of control which overemphasizes the role of skill and neglects the role of luck, and there is a focus on what one knows and a neglect of what one does not, etc. The market already knows this: the stock of the acquirer usually suffers a sell-off upon announcement of the acquisition, because the result of any acquisition is more often bad than good, but the question is whether it has sufficiently discounted this phenomenon. Would shorting the stock of an acquirer at the completion of an acquisition and holding the short position for, say, 5 years, hedging this position with SPY, be profitable?
3) Premortem. After designing a trading strategy, it is always useful to write a brief imaginary history of how it has become an unmitigated financial disaster for you a few years from now. This will likely reveal scenarios that you have not previously thought of, and triggering additional risk management measures.
4) Risk seeking in the face of losses. Suppose you are running a strategy that has a fixed holding period. Have you ever extended this holding period when the position is losing, in the hope that the position will recoup some of its losses? I have, and the result was double the loss I would have suffered had I exited on time. Apparently this is a very common suboptimal behavioral bias: this is why many defendants with a weak legal case often risk continued litigations instead of accepting an unfavorable settlement.
5) Why do we often demand Sharpe ratio >=2? Psychological experiments have shown that people find the pain of losing $1 can only be compensated by the pleasure of winning $2. So if we equate standard deviation as the average drawdown of a strategy, then we need to have twice the average return!
Many businesses have profited from arbitraging the difference between rational decisions and biased decisions that people commonly made. (For e.g. lottery franchises benefit from people overweighting the probability of winning, sellers of extended warranties benefit from buyers' risk-aversion.) I wonder if there are still opportunities left for rational traders to take advantage of the biased decisions of irrational traders?
Monday, January 30, 2012
What worked in 2011?
We all know that 2011 was a bad year for many hedge funds, with the average fund down 5%. But what type of strategies did well, and what did particularly poorly? The numbers are out: Forex funds lose more than average, down 6%. In fact, 71 out of 77 Forex funds tracked by a Citigroup currency analyst were down in 2011. And the winners are? Statarb funds, with a 5% averge return.
This superior performance of statarb funds is quite a contrast from the last financial crisis 2007-9. Then, most of the big factor-driven statarb models failed miserably. What caused this difference? Is it because the risk management techniques of big funds have improved? Or maybe that's because in 2011, the deviation from factor returns mean-revert within a few days, so those statarb models that re-balance on a daily basis can benefit from the buying/selling opportunity at steep discount/premium?
To settle this question, let me report the 2011 backtest results (without transaction costs) of running Andrew Lo's prototype mean-reversion model : ranking stocks based on their previous day's returns, shorting the top decile and buying the bottom one, rebalancing only at the close. (Click on chart to make it larger.)
The APR in 2011 was 18.6%. Note in particular its performance since the crisis began officially on 20110808: despite a steep drawdown, the overall performance was spectacular! Clearly, high volatility benefited a prototypical statarb strategy, and the out-performance has not much to do with improved risk management.
You might wonder what would happen if we had used the intraday version of this strategy instead: enter all positions at the open, and exit them all at the close? I tried it: the performance is surprisingly similar to the interday strategy. So intraday vs. interday volatility or mean-reversion does not seem to play a part in last year's equities market. Contrasting this with the performance of Forex models, it is clear that high volatilities benefited statarb models while they hurt FX models.
In the next article or two, I will explore the 2011 performance of some other equities mean-reverting models that I used to trade. But what about your models? If you have some thoughts on what worked and what didn't in 2011, please share them with us in the comments section.
This superior performance of statarb funds is quite a contrast from the last financial crisis 2007-9. Then, most of the big factor-driven statarb models failed miserably. What caused this difference? Is it because the risk management techniques of big funds have improved? Or maybe that's because in 2011, the deviation from factor returns mean-revert within a few days, so those statarb models that re-balance on a daily basis can benefit from the buying/selling opportunity at steep discount/premium?
To settle this question, let me report the 2011 backtest results (without transaction costs) of running Andrew Lo's prototype mean-reversion model : ranking stocks based on their previous day's returns, shorting the top decile and buying the bottom one, rebalancing only at the close. (Click on chart to make it larger.)
You might wonder what would happen if we had used the intraday version of this strategy instead: enter all positions at the open, and exit them all at the close? I tried it: the performance is surprisingly similar to the interday strategy. So intraday vs. interday volatility or mean-reversion does not seem to play a part in last year's equities market. Contrasting this with the performance of Forex models, it is clear that high volatilities benefited statarb models while they hurt FX models.
In the next article or two, I will explore the 2011 performance of some other equities mean-reverting models that I used to trade. But what about your models? If you have some thoughts on what worked and what didn't in 2011, please share them with us in the comments section.
Tuesday, December 27, 2011
Risk indicators
During the financial crisis of 2008, I wrote about how I watched some risk indicators such as the VIX or the TED spread to decide what leverage I should use for my trading strategies. It turns out that this procedure is just as critical for the current crisis that began in August 2011. In fact, more than leverage-determinants, they can be used as the all-important variable that determines whether a certain strategy should be run at all. (What's the point of running a model that you think will lose money with low leverage?)
There are now more than a few of these risk indicators to pick from. Besides the VIX and the TED, there are the VSTOXX (EURO STOXX 50 Volatility), the VXY (JPMorgan G7 Volatility Index), the EM-VXY (JPMorgan Emerging Market Volatility Index), the ETF's ONN and OFF, and probably many more that I haven't heard of yet.
A lot of academic research has been done on whether we can devise "regime switching" models based on some complicated pattern-recognition algorithms to decide whether a market is in a certain "regime" which favors this or that particular model or parameter set. And often, these regime switching models rely on the recognition of some complicated set of patterns in the historical price series. Sorry to say, I have not found any of these complex regime switching model to have any real out-of-sample predictive power. On the other hand, my research shows that some of the aforementioned simple risk indicators will indeed prevent some trading models from falling off the cliff.
But which of these indicators are applicable to which model? This is not so obvious. For example, you might think that the EM-VXY would be an ideal leading indicator for Forex trading models that involve emerging market currencies, but I have found that it is only a contemporaneous (and thus useless) indicator to mine. Another example, I said during the 2008 financial crisis that VIX seems to be a useless contemporaneous indicator for equities trading models, but strangely, it is a good leading indicator for FX models. In contrast, the TED spread that everyone were obsessed about in 2008 shot up to over 300 bps then, but never went beyond 100 bps this time around. So really only rigorous backtesting can guide us here.
What risk indicators do you use? And have you really backtested their efficacies? Your comments would be very welcome here.
There are now more than a few of these risk indicators to pick from. Besides the VIX and the TED, there are the VSTOXX (EURO STOXX 50 Volatility), the VXY (JPMorgan G7 Volatility Index), the EM-VXY (JPMorgan Emerging Market Volatility Index), the ETF's ONN and OFF, and probably many more that I haven't heard of yet.
A lot of academic research has been done on whether we can devise "regime switching" models based on some complicated pattern-recognition algorithms to decide whether a market is in a certain "regime" which favors this or that particular model or parameter set. And often, these regime switching models rely on the recognition of some complicated set of patterns in the historical price series. Sorry to say, I have not found any of these complex regime switching model to have any real out-of-sample predictive power. On the other hand, my research shows that some of the aforementioned simple risk indicators will indeed prevent some trading models from falling off the cliff.
But which of these indicators are applicable to which model? This is not so obvious. For example, you might think that the EM-VXY would be an ideal leading indicator for Forex trading models that involve emerging market currencies, but I have found that it is only a contemporaneous (and thus useless) indicator to mine. Another example, I said during the 2008 financial crisis that VIX seems to be a useless contemporaneous indicator for equities trading models, but strangely, it is a good leading indicator for FX models. In contrast, the TED spread that everyone were obsessed about in 2008 shot up to over 300 bps then, but never went beyond 100 bps this time around. So really only rigorous backtesting can guide us here.
What risk indicators do you use? And have you really backtested their efficacies? Your comments would be very welcome here.
Friday, November 11, 2011
Trading platform and EC2 revisited
Recently I opened a discussion on the various software platforms which allow the programmers among us to build trading strategies easily. Here is one other addition: Quantopian. It is only in alpha stage, but I did get a preview of its features:
1) You can code in Python, which is an easier language to learn than Java, but no less powerful. In fact, I know of a superb programmer who uses Python to backtest HF strategies.
2) It is web-based, which means you can take advantage of collocation on a server much more stable than your own desktops. (For those who worry about the confidentiality of your strategies, the founder indicated to me that they can run an image of the software on an Amazon EC2 account that you owned so they won't have access to your codes. As for the confidentiality of codes residing on EC2 itself, please see below*.)
3) It is event-driven (or for those who like the latest jargon: CEP-enabled), like all the Java API's that I discussed in the previous article.
4) They have 1-min US equities data for backtesting. Tick-level data will be available soon.
5) Toolboxes for common technical indicators, mathematical algorithms, etc. will be available soon.
6) They will run a competition for trading models which makes it easier for independent traders to become trading advisers to others, or to raise money for their own funds.
Unfortunately, live walk-forward testing is not yet available.
* Some readers have wondered whether it is safe to run their trading models on Amazon's EC2. Won't Amazon's employees have access to their wildly profitable strategies? The answer is no: Amazon's security policy:
1) You can code in Python, which is an easier language to learn than Java, but no less powerful. In fact, I know of a superb programmer who uses Python to backtest HF strategies.
2) It is web-based, which means you can take advantage of collocation on a server much more stable than your own desktops. (For those who worry about the confidentiality of your strategies, the founder indicated to me that they can run an image of the software on an Amazon EC2 account that you owned so they won't have access to your codes. As for the confidentiality of codes residing on EC2 itself, please see below*.)
3) It is event-driven (or for those who like the latest jargon: CEP-enabled), like all the Java API's that I discussed in the previous article.
4) They have 1-min US equities data for backtesting. Tick-level data will be available soon.
5) Toolboxes for common technical indicators, mathematical algorithms, etc. will be available soon.
6) They will run a competition for trading models which makes it easier for independent traders to become trading advisers to others, or to raise money for their own funds.
Unfortunately, live walk-forward testing is not yet available.
* Some readers have wondered whether it is safe to run their trading models on Amazon's EC2. Won't Amazon's employees have access to their wildly profitable strategies? The answer is no: Amazon's security policy:
Guest Operating System: Virtual instances are completely controlled by the customer. Customers have full root access
or administrative control over accounts, services, and applications. AWS does not have any access rights to customer
instances and cannot log into the guest OS....
Thanks to a reader OL from France who provided me with this info. He also told me that:
"So, I finally deployed my momentum strategy on a Linux instance of EC2 (which is free btw).
I wrote it based on the java demo application provided by Interactive Brokers and some parts of Algoquant.
So far, I use a European instance of EC2 which alas doesn't have the best latency to IB US servers (90 ms) but still better than my bedroom connection.
A test ping from a US instance to IB US servers results in only 15 ms ..."
So there you go: Java+Algoquant+IB+EC2=profit.
Friday, September 30, 2011
Stop loss, profit cap, survivorship bias, and black swans
I have long espoused the view that we should not impose stop-losses on mean-reverting strategies, nor profit caps on momentum strategies. My view on the latter has not changed, but it has evolved on the former.
My original reason for opposing stop-losses on mean-reverting strategy is this. Say you believe your specific price series is mean-reverting, and say you have entered into a long position when the price is low. Now, however, the price gets much lower, and you are suffering a large unrealized loss. Well, based on your mean-reverting belief, you should buy more instead of liquidating! Indeed, if you backtest the effect of stop-losses on mean-reverting strategies, you will almost inevitably find that they decrease the overall returns and even Sharpe ratios.
But what this simplistic view ignored is 1) survivorship bias, and 2) black swan events. (Hat tip: Ben, who prompted me to consider these two issues.)
1) We normally would only trade those price series with a mean-reverting strategy only if we see that the prices did eventually revert. No one would bother to trade those price series that used to mean-revert, but suddenly stopped doing so. But saying that stop-losses are harmful to mean-reverting strategies is ignoring the fact that some mean-reverting will stop working altogether and would not survive our strategies selection process.
2) Let's define black swan events as those that did not occur in your backtest period. For example, let's say you never had a loss of 20% in a single day. So if you backtest a stop-loss of 20%, it will have no effect whatsoever on your backtest performance. However, no one can say for sure that it won't occur in the future. So if you or your investors simply cannot tolerate a 20% loss, you should impose this as a stop-loss. (After all, your brokerage has already imposed a stop-loss of 100% on you whether you like it or not.)
We can in fact turn point 2) around when deciding what stop-loss to use: a stop-loss should be loose enough so that it should have no effect on the backtest performance, and of course tight enough so that it will not result in the demise of your trading career.
There is also the issue of whether to use stop-loss on the intraday drawdown, or to use it on the multiple-day drawdown. I would argue that only intraday stop-loss is important to prevent a black-swan loss. In practice, when a strategy has a string of non-catastrophic losses occurring over multiple days, resulting in a large, unprecedented, drawdown, the trader will typically re-examine the strategy, taking into account this most recent performance and tweak the strategy so that it could theoretically be avoided. This is almost like a multi-day stop-loss strategy, as we stop an old strategy and start a new, modified, one. (Though the modified strategy might still recommend that you keep holding the current position!)
Now why am I still holding dear to the principle that one should not impose profit-caps on momentum strategies? Why, the possibility of black swan events again! But this time, any black swan can only result in unprecedented one-day gain instead of loss, since we should always have stop-losses on momentum strategies. We certainly don't want to impose a profit-cap to rule out this possibility!
My original reason for opposing stop-losses on mean-reverting strategy is this. Say you believe your specific price series is mean-reverting, and say you have entered into a long position when the price is low. Now, however, the price gets much lower, and you are suffering a large unrealized loss. Well, based on your mean-reverting belief, you should buy more instead of liquidating! Indeed, if you backtest the effect of stop-losses on mean-reverting strategies, you will almost inevitably find that they decrease the overall returns and even Sharpe ratios.
But what this simplistic view ignored is 1) survivorship bias, and 2) black swan events. (Hat tip: Ben, who prompted me to consider these two issues.)
1) We normally would only trade those price series with a mean-reverting strategy only if we see that the prices did eventually revert. No one would bother to trade those price series that used to mean-revert, but suddenly stopped doing so. But saying that stop-losses are harmful to mean-reverting strategies is ignoring the fact that some mean-reverting will stop working altogether and would not survive our strategies selection process.
2) Let's define black swan events as those that did not occur in your backtest period. For example, let's say you never had a loss of 20% in a single day. So if you backtest a stop-loss of 20%, it will have no effect whatsoever on your backtest performance. However, no one can say for sure that it won't occur in the future. So if you or your investors simply cannot tolerate a 20% loss, you should impose this as a stop-loss. (After all, your brokerage has already imposed a stop-loss of 100% on you whether you like it or not.)
We can in fact turn point 2) around when deciding what stop-loss to use: a stop-loss should be loose enough so that it should have no effect on the backtest performance, and of course tight enough so that it will not result in the demise of your trading career.
There is also the issue of whether to use stop-loss on the intraday drawdown, or to use it on the multiple-day drawdown. I would argue that only intraday stop-loss is important to prevent a black-swan loss. In practice, when a strategy has a string of non-catastrophic losses occurring over multiple days, resulting in a large, unprecedented, drawdown, the trader will typically re-examine the strategy, taking into account this most recent performance and tweak the strategy so that it could theoretically be avoided. This is almost like a multi-day stop-loss strategy, as we stop an old strategy and start a new, modified, one. (Though the modified strategy might still recommend that you keep holding the current position!)
Now why am I still holding dear to the principle that one should not impose profit-caps on momentum strategies? Why, the possibility of black swan events again! But this time, any black swan can only result in unprecedented one-day gain instead of loss, since we should always have stop-losses on momentum strategies. We certainly don't want to impose a profit-cap to rule out this possibility!
Sunday, September 18, 2011
More on automated trading platforms
The ideal software platform for automating backtesting and executing your algorithmic trading strategies depends mainly on your level of programming expertise and your budget. If you are a competent programmer in, say, Java or C#, there is nothing to prevent you from utilizing the API offered (usually for free) by many brokerages to automate execution. And of course, it is also easy for you to write a separate backtesting program utilizing historical data. However, even for programmer-traders, there are a couple of inconveniences in developing these programs from scratch:
A) Every time we change brokerages, we have to re-write parts of the low-level functions that utilize the brokerage's API;
B) The automated trading program cannot be used to backtest unless a simulator is built to feed the historical data into the program as if they were live. To reduce bugs, it is better to have the same code that both backtests and trades live.
This is where a number of open-source algorithmic trading development platforms come in. These platforms all assume that the user is a Java programmer. But they eliminate the hassles A) and B) above as they serve as the layer that shield you from the details of the brokerage's API, and let you go from backtesting to live trading mode with a figurative turn of a key. I have taken a tour of one such platforms Marketcetera, and will highlight some features here:
1) It has a trading GUI with features similar to that of IB's TWS. This will be useful if your own brokerage's GUI is dysfunctional.
2) Complex Event Processing (CEP) is available as a module. CEP is essentially a way for you to easily specify what kind of market/pricing events should trigger a trading action. For e.g., "BUY if ask price is below 20-min moving average." Of course, you could have written this trading rule in a callback function, but to retrieve the 20-min MA on-demand could be quite messy. CEP solves that data retrieval problem for you by storing only those data that is needed by your registered trading rules.
3) It can use either FIX or a brokerage's API for connection. Available brokerage connectors include Interactive Brokers and Lime Brokerage.
4) It offers a news feed, which can be used by your trading algorithms to trigger trading actions if you use Java's string processing utilities to parse the stories properly.
5) The monthly cost ranges from $3,500 - $4,500.
If Marketcera is beyond your budget, you can check out AlgoTrader. It has advantages 1)-3) but not 4) listed above, and is completely free. I invite readers who have tried these or other similar automated trading platforms to comment their user experience here.
P.S. For those of us who use Matlab to automate our executions, a reader pointed out there is a new product MATTICK that allows you to send order via the FIX protocol which should let us trade with a great variety of brokerages.
A) Every time we change brokerages, we have to re-write parts of the low-level functions that utilize the brokerage's API;
B) The automated trading program cannot be used to backtest unless a simulator is built to feed the historical data into the program as if they were live. To reduce bugs, it is better to have the same code that both backtests and trades live.
This is where a number of open-source algorithmic trading development platforms come in. These platforms all assume that the user is a Java programmer. But they eliminate the hassles A) and B) above as they serve as the layer that shield you from the details of the brokerage's API, and let you go from backtesting to live trading mode with a figurative turn of a key. I have taken a tour of one such platforms Marketcetera, and will highlight some features here:
1) It has a trading GUI with features similar to that of IB's TWS. This will be useful if your own brokerage's GUI is dysfunctional.
2) Complex Event Processing (CEP) is available as a module. CEP is essentially a way for you to easily specify what kind of market/pricing events should trigger a trading action. For e.g., "BUY if ask price is below 20-min moving average." Of course, you could have written this trading rule in a callback function, but to retrieve the 20-min MA on-demand could be quite messy. CEP solves that data retrieval problem for you by storing only those data that is needed by your registered trading rules.
3) It can use either FIX or a brokerage's API for connection. Available brokerage connectors include Interactive Brokers and Lime Brokerage.
4) It offers a news feed, which can be used by your trading algorithms to trigger trading actions if you use Java's string processing utilities to parse the stories properly.
5) The monthly cost ranges from $3,500 - $4,500.
If Marketcera is beyond your budget, you can check out AlgoTrader. It has advantages 1)-3) but not 4) listed above, and is completely free. I invite readers who have tried these or other similar automated trading platforms to comment their user experience here.
P.S. For those of us who use Matlab to automate our executions, a reader pointed out there is a new product MATTICK that allows you to send order via the FIX protocol which should let us trade with a great variety of brokerages.
Saturday, July 23, 2011
Sorry, your return is too high for us
I enjoyed reading Richard Wilson's The Hedge Fund Book (Richard also runs the Hedge Fund Blogger site). To be clear: it is purely marketing-oriented. It doesn't tell you how to find a successful trading strategy, but its focus is to tell you how to market your fund to investors once you have a successful strategy. To that end, it does a pretty good job in conveying what might be conventional wisdom to seasoned fund managers. (For e.g., don't bother to market to institutional investors if your AUM is less than $100M.) The book is filled with quite engaging interviews with fund managers, fund marketers, and other fund service providers (including our very own administrator Fund Associates). If Scott Patterson's The Quants is about the gods of hedge funds, this book is for and about the mortals.
One paragraph in the book stood out: "I've worked closely on the third-party marketing and capital introduction/prime brokerage side of the business, and I often see both types of firms deny clients service [to funds with high returns and high risk] ... Nobody wants to be associated with a manager aiming at 30 percent a month returns."
Maybe not aiming at, but what's wrong with achieving a 30 percent a month returns? I have actually met institutional investors who don't want to look at a fund that actually achieved double-digit monthly returns. Presumably that's because they believe that a high return automatically implies high risk, and also presumably a high leverage as well. I would argue that there are 2 reasons not to completely dismiss such funds out-of-hand:
1) Leverage should not be determined arbitrarily, but should be based on the minimum of what's dictated by half-Kelly (see my extensive discussions of Kelly formula on this blog and in my book) and what's dictated by the maximum single-day drawdown seen historically or in VaR simulations. And if this minimum still turns out to be higher than what most institutional investors are comfortable with, one should be bold enough to adopt it in your fund.
2) As an investor, there is an easy way to control leverage and risk: just apply Constant Proportion Portfolio Insurance (a concept also discussed elsewhere on this blog). For example, if the fund manager tells you the fund employs a constant 10x leverage (as dictated by the risk analysis outlined in 1) and you are only comfortable with 5x leverage, just invest half your capital into the fund, and keep the other half as cash in your bank account! Going forward, if the fund loses money, your effective leverage would have decreased to below 5x. Say you invested $1M into the fund, and kept $1M in the bank. And say the fund lost $0.5M. Your total equity is now $1.5M, and the fund manager is supposed to trade a $0.5M*10=$5M portfolio. Your effective leverage is now only 3.33x, well within your tolerance. Now if instead, the fund made money, you can immediately withdraw some of the profits to keep your effective leverage at 5x. So, say the fund made $0.5M. Your equity is now $2.5M, and the fund manager is supposed to trade a $1.5M*10=$15M portfolio. If you don't withdraw, this would increase your effective leverage to 6x. But if you immediately withdraw $0.25M, then the fund manager will trade a $1.25M*10=$12.5M portfolio, giving you an effective leverage of the desired 5x.
If you are an investor in hedge funds, please let us know what you think of this scheme in the comments section!
One paragraph in the book stood out: "I've worked closely on the third-party marketing and capital introduction/prime brokerage side of the business, and I often see both types of firms deny clients service [to funds with high returns and high risk] ... Nobody wants to be associated with a manager aiming at 30 percent a month returns."
Maybe not aiming at, but what's wrong with achieving a 30 percent a month returns? I have actually met institutional investors who don't want to look at a fund that actually achieved double-digit monthly returns. Presumably that's because they believe that a high return automatically implies high risk, and also presumably a high leverage as well. I would argue that there are 2 reasons not to completely dismiss such funds out-of-hand:
1) Leverage should not be determined arbitrarily, but should be based on the minimum of what's dictated by half-Kelly (see my extensive discussions of Kelly formula on this blog and in my book) and what's dictated by the maximum single-day drawdown seen historically or in VaR simulations. And if this minimum still turns out to be higher than what most institutional investors are comfortable with, one should be bold enough to adopt it in your fund.
2) As an investor, there is an easy way to control leverage and risk: just apply Constant Proportion Portfolio Insurance (a concept also discussed elsewhere on this blog). For example, if the fund manager tells you the fund employs a constant 10x leverage (as dictated by the risk analysis outlined in 1) and you are only comfortable with 5x leverage, just invest half your capital into the fund, and keep the other half as cash in your bank account! Going forward, if the fund loses money, your effective leverage would have decreased to below 5x. Say you invested $1M into the fund, and kept $1M in the bank. And say the fund lost $0.5M. Your total equity is now $1.5M, and the fund manager is supposed to trade a $0.5M*10=$5M portfolio. Your effective leverage is now only 3.33x, well within your tolerance. Now if instead, the fund made money, you can immediately withdraw some of the profits to keep your effective leverage at 5x. So, say the fund made $0.5M. Your equity is now $2.5M, and the fund manager is supposed to trade a $1.5M*10=$15M portfolio. If you don't withdraw, this would increase your effective leverage to 6x. But if you immediately withdraw $0.25M, then the fund manager will trade a $1.25M*10=$12.5M portfolio, giving you an effective leverage of the desired 5x.
If you are an investor in hedge funds, please let us know what you think of this scheme in the comments section!
Monday, July 18, 2011
The social utility of hedge funds
There is an article in the New Yorker magazine profiling Bridgewater Associates, the world's biggest global macro hedge fund. Inevitably, we come to the awkward question: "If hedge-fund managers are playing a zero-sum game, what is their social utility?"
I thought about this question a lot in the past, and I used to agree with many others that the social utility of hedge funds, or trading in general, is to provide liquidity to the markets. And a good economic case can be made that the more liquid a market is, the higher the utility it is to all participants. However, based on recent experience of flash crash and other unfortunate mishaps, we find out that traders typically do not provide liquidity when it is needed most! So this answer becomes quite unsatisfactory.
In trying to come up with a better reply, I though it is curious that few people asked "What is the purpose of having a Department of Defence?" since wars between nations are typically also zero-sum games, yet we greatly honour those who serve in the armed forces (in contrast to our feelings for hedge fund managers).
To me, clearly the answer with the best moral justification is that, in both cases, there is great social utility in defending either your clients' comfortable retirement from financial meltdown (e.g. due to governmental or corporate mismanagement), or in defending your country from foreign aggression. More specifically, the purpose of hedge funds is to reduce long-term volatility in your clients' net worth. (I would like to say "reduce risks to your clients' net worth", but that would be a bit too optimistic!)
I emphasize long-term volatility, because of course trading generates a lot of daily or hourly volatility in your clients' equity. But I do not believe that such short-term volatility affects ones' life goals. On the other hand, a 3-or-more-year drawdown in a typical buy-and-hold portfolio can wreck havoc with many lives.
I thought about this question a lot in the past, and I used to agree with many others that the social utility of hedge funds, or trading in general, is to provide liquidity to the markets. And a good economic case can be made that the more liquid a market is, the higher the utility it is to all participants. However, based on recent experience of flash crash and other unfortunate mishaps, we find out that traders typically do not provide liquidity when it is needed most! So this answer becomes quite unsatisfactory.
In trying to come up with a better reply, I though it is curious that few people asked "What is the purpose of having a Department of Defence?" since wars between nations are typically also zero-sum games, yet we greatly honour those who serve in the armed forces (in contrast to our feelings for hedge fund managers).
To me, clearly the answer with the best moral justification is that, in both cases, there is great social utility in defending either your clients' comfortable retirement from financial meltdown (e.g. due to governmental or corporate mismanagement), or in defending your country from foreign aggression. More specifically, the purpose of hedge funds is to reduce long-term volatility in your clients' net worth. (I would like to say "reduce risks to your clients' net worth", but that would be a bit too optimistic!)
I emphasize long-term volatility, because of course trading generates a lot of daily or hourly volatility in your clients' equity. But I do not believe that such short-term volatility affects ones' life goals. On the other hand, a 3-or-more-year drawdown in a typical buy-and-hold portfolio can wreck havoc with many lives.
If one day, the markets become so quiescent that few hedge funds can generate higher Sharpe ratio than a buy-and-hold portfolio (as indeed seems to be the case with the US equities markets these days), then yes, most hedge fund managers should just quit, instead of hogging intellectual resources from our best universities.
Sunday, July 03, 2011
Hedge fund transparency and "barometers"
Jim Liew of Alpha Quant Club recently posted an interesting article about the increasing demand for transparency of hedge fund strategies by institutional investors, so much so that they are essentially willing to invest only in managed accounts with real-time trades and positions updates. This is, of course, bad for fund managers, since not only can the investor reverse-engineer the simpler strategies from such knowledge, they can also piggy-back on the trades, thus paying a much smaller portion of their profits as performance fee. One might be tempted to think that since the investors are going to reverse-engineer the product anyway, why not just make it as simple and as generic as possible, and charge a much lower fee than the usual 2-20 (which hopefully will attract a much larger investor base), so that the main value to the investor is just convenience and not the originality of the strategy?
In fact, Jim wants to do just that. He proposes to construct hedge fund "barometers", essentially prototypical hedge fund strategies running in managed accounts. This would work well if these barometers have large enough capacities such that the performance can hold up even when a large number of investors sign up. From the investors' point of view, this is a trade-off between investing in a truly outstanding, high-performance strategy while paying a large fee and losing "transparency", versus just investing in a generic strategy that may still outperform the broad market. For some institutional investors, this might just be the bargain they are looking for.
In fact, Jim wants to do just that. He proposes to construct hedge fund "barometers", essentially prototypical hedge fund strategies running in managed accounts. This would work well if these barometers have large enough capacities such that the performance can hold up even when a large number of investors sign up. From the investors' point of view, this is a trade-off between investing in a truly outstanding, high-performance strategy while paying a large fee and losing "transparency", versus just investing in a generic strategy that may still outperform the broad market. For some institutional investors, this might just be the bargain they are looking for.
Friday, June 17, 2011
When cointegration of a pair breaks down
I have written a lot in the past about the cointegration of ETF pairs, and how this condition can lead to profitable pairs trading. However, as every investment advisor could have told you, past cointegration is no guarantee of future cointegration. Often, cointegration for a pair breaks down for an extended period, maybe as long as a half a year or more. Naturally, trading this pair during this period is a losing proposition, but abandoning such a pair completely is also unsatisfactory, since cointegration often mysteriously returns after a while.
A case in point is the ETF pair GLD-GDX. When I first tested it in 2006, it was an excellent candidate for pair trading, and I not only traded it in my personal portfolio, but we traded it in our fund too. Unfortunately, it went haywire in 2008. We promptly abandoned it, only to see the strategy recovered sharply in 2007.
So the big question is: how do we know whether the loss of cointegration is temporary, and how do we know when to resume trading a pair?
To answer the first question, it is often necessary to go beyond the technicals, and delve into the fundamentals of pair. Take GLD-GDX as the example. When I taught my pairs trading workshop in South Africa, several portfolio managers in attendance told me that there are 2 reasons why gold spot price diverged from gold miners' stock prices. Firstly, due to the sharp increase in oil prices during the first half of 2008, it costs the gold miners a lot more in energy to extract the gold from the ground, hence the gold miners' income lags behind the rise in gold prices. Secondly, many gold miners hedge their exposure to fluctuating gold prices with derivatives. Hence when gold price rise beyond a certain limit, the gold miners cease to benefit from this rise. Recently, the Economist magazine published an article that essentially confirms this view. But further confirmation can be gained by introducing oil (future) price into the cointegration equation. If you do that, and if you trade this triplet of GLD-GDX-USO, you will find that it is profitable throughout the entire period from 2006-2010. If you find trading a triplet too complicated, you can at least backtest a trading filter such that you will cease to trade GLD-GDX whenever USO goes beyond (above, and maybe below too) a certain band. If you have done all these backtests, you will have a plan in place to tell you when to resume trading this pair. But even if you haven't done this backtest, and you find that you need to stop trading a pair because of cumulating losses, you should at least continue paper trading it to see when it is turning around!
(By the way, if you think trading ETF pairs offers too low returns due to the low leverage allowed, consider the single stock futures on ETF's trading on the OneChicago exchange. Certainly the future on GDX is available there, while you might just trade the futures GC and CL directly on CME. There is, of course, the usual caveat that applies to futures pairs trading: the switch from contango to backwardation and vice versa can ruin many a pairs-trading strategy, even if the spot prices remain cointegrating. But that's a story for another time.)
A case in point is the ETF pair GLD-GDX. When I first tested it in 2006, it was an excellent candidate for pair trading, and I not only traded it in my personal portfolio, but we traded it in our fund too. Unfortunately, it went haywire in 2008. We promptly abandoned it, only to see the strategy recovered sharply in 2007.
So the big question is: how do we know whether the loss of cointegration is temporary, and how do we know when to resume trading a pair?
To answer the first question, it is often necessary to go beyond the technicals, and delve into the fundamentals of pair. Take GLD-GDX as the example. When I taught my pairs trading workshop in South Africa, several portfolio managers in attendance told me that there are 2 reasons why gold spot price diverged from gold miners' stock prices. Firstly, due to the sharp increase in oil prices during the first half of 2008, it costs the gold miners a lot more in energy to extract the gold from the ground, hence the gold miners' income lags behind the rise in gold prices. Secondly, many gold miners hedge their exposure to fluctuating gold prices with derivatives. Hence when gold price rise beyond a certain limit, the gold miners cease to benefit from this rise. Recently, the Economist magazine published an article that essentially confirms this view. But further confirmation can be gained by introducing oil (future) price into the cointegration equation. If you do that, and if you trade this triplet of GLD-GDX-USO, you will find that it is profitable throughout the entire period from 2006-2010. If you find trading a triplet too complicated, you can at least backtest a trading filter such that you will cease to trade GLD-GDX whenever USO goes beyond (above, and maybe below too) a certain band. If you have done all these backtests, you will have a plan in place to tell you when to resume trading this pair. But even if you haven't done this backtest, and you find that you need to stop trading a pair because of cumulating losses, you should at least continue paper trading it to see when it is turning around!
(By the way, if you think trading ETF pairs offers too low returns due to the low leverage allowed, consider the single stock futures on ETF's trading on the OneChicago exchange. Certainly the future on GDX is available there, while you might just trade the futures GC and CL directly on CME. There is, of course, the usual caveat that applies to futures pairs trading: the switch from contango to backwardation and vice versa can ruin many a pairs-trading strategy, even if the spot prices remain cointegrating. But that's a story for another time.)
Thursday, June 02, 2011
Even more on news driven trading
News driven trading is even more in vogue today than when I last mentioned it, judging from the increasing number of vendors (e.g. Ravenpack, Sensobeat, Recorded Future, etc.) and researchers pitching their wares. Not only are traditional financial and economic news deemed important, but researchers have found even blog posts (at least those on Seeking Alpha) and Twitter (Hat tip: Satya and William) to be predictive of stock prices.
One key ingredient to success in this type of trading is of course the ability to gain access to breaking news ahead of other traders. On the macroeconomic news front, the MIT Billion Prices project has spun off a company called PriceStats to deliver daily consumer product price index to subscribers. PriceStats compiles this index by continuously scanning online retailers' websites, and hopefully provides a preview of the official CPI numbers. Whether this is useful for futures and currencies traders is of course subject to their rigorous backtests, though the chart displayed on their website does suggest that the daily price index is a leading indicator of the CPI.
There is an important caveat to using news trading: not all news are equal. So another key ingredient to success is to carefully differentiate between the different types of news and backtest their predictive abilities separately. For example, I recall some research has indicated that an analyst downgrade of a stock from a "hold" to a "sell" rating has more impact than from "buy" to "hold" rating.
My own experience with news driven trading is that for all this trouble, the trading opportunities are relatively few compared to pure price driven trading, the consistency of success is low, and finally the profitability lifespan is short. If you have better experience, do share it with us.
One key ingredient to success in this type of trading is of course the ability to gain access to breaking news ahead of other traders. On the macroeconomic news front, the MIT Billion Prices project has spun off a company called PriceStats to deliver daily consumer product price index to subscribers. PriceStats compiles this index by continuously scanning online retailers' websites, and hopefully provides a preview of the official CPI numbers. Whether this is useful for futures and currencies traders is of course subject to their rigorous backtests, though the chart displayed on their website does suggest that the daily price index is a leading indicator of the CPI.
There is an important caveat to using news trading: not all news are equal. So another key ingredient to success is to carefully differentiate between the different types of news and backtest their predictive abilities separately. For example, I recall some research has indicated that an analyst downgrade of a stock from a "hold" to a "sell" rating has more impact than from "buy" to "hold" rating.
My own experience with news driven trading is that for all this trouble, the trading opportunities are relatively few compared to pure price driven trading, the consistency of success is low, and finally the profitability lifespan is short. If you have better experience, do share it with us.
Tuesday, May 17, 2011
A platform, a shareware site, and some courses for quant traders
I mentioned in various places that Alphacet Discovery is an industrial strength integrated platform for backtesting and implementing quantitative trading strategies. But of course, it has many competitors, one of which is a relatively new company called Deltix. Deltix has the distinction of offering a full Matlab interface, which is convenient if you are already a Matlab programmer. (Full disclosure: I previously have a consulting relationship with Alphacet, but have none with Deltix.)
There is also a new website for sharing trading strategy software called Quantonomics. In the words of its founder Joshua, the goal is to "connect programmers and stock traders". Joshua also told me that he will create a custom application on his site for any of you readers as a gift!
A colleague of mine in Singapore, Dr. Li Haksun, who was previously a quant with UBS and BNP Paribas, is offering a course on quantitative trading strategy in July. It covers more theoretical concepts than my own courses: e.g. hidden markov model, stochastic control, and Kalman filters are included.
And of course, my own workshops on Backtesting and Statistical Arbitrage will be offered again in London next week.
There is also a new website for sharing trading strategy software called Quantonomics. In the words of its founder Joshua, the goal is to "connect programmers and stock traders". Joshua also told me that he will create a custom application on his site for any of you readers as a gift!
A colleague of mine in Singapore, Dr. Li Haksun, who was previously a quant with UBS and BNP Paribas, is offering a course on quantitative trading strategy in July. It covers more theoretical concepts than my own courses: e.g. hidden markov model, stochastic control, and Kalman filters are included.
And of course, my own workshops on Backtesting and Statistical Arbitrage will be offered again in London next week.
Tuesday, May 10, 2011
Time-of-day effects in FX trading
As I mentioned in a previous post, one of the main ingredients of success in constructing a profitable momentum trading strategy in Forex (and futures) is to pay attention to the entry and exit times. I haven't seen any good momentum strategy that has "time-translation invariance", i.e. works without reference to a fixed time of the day. The fixed time can refer to a benchmark level of the market (e.g. the previous close), or it can be the entry or exit time. (This is in contrast to mean-reverting strategies where the reference price can often be just a moving average.) A recent research paper (Hat tip: William) points to another example of such time-of-day effects in FX markets: a currency typically depreciates during its local trading hours.
Subscribe to:
Posts (Atom)