Icon

TRADING THE ODDS

Icon

A quantitative approach to profit in the US equity and futures markets, trading the markets like professional card counters are playing Blackjack or expert poker players are playing Poker. The key is to have the odds on your side and bet accordingly, knowing what, when, where, why and how much you bet on each trade or wager.


By proceeding beyond this point and/or using the information presented on this site(s) the reader is deemed to have read, understood and fully and without reservation accepted the terms and conditions laid down in the Disclaimer. The information, analysis and commentary on this site is provided for statistical and informational purposes only. Nothing herein should be interpreted or regarded as personalized investment advice or to state or imply that past results are an indication of future performance. The author of this website is not a licensed financial advisor and will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on the content of this website(s). Under no circumstances does this information represent a recommendation or advice to buy, sell or hold any security.
( Data courtesy of MetaStock http://www.equis.com/ )

Pairs Trading Part II – SPY vs. RTH

One of the most interesting findings dealt with in a previous posting (Pairs Trading (ETFs) was the RTHs (Retail HOLDR.) salient feature of being a favorable candidate for a potential mean-reversion strategy in conjunction with a major market or sector ETF. With respect to the primarily method used for cointegration (the augmented Dickey-Fuller test), the RTH showed a probability better than 90% of being cointegrated with the IWM (Russel 2000) and the SMH (Semiconductor HOLDR.), and missed being cointegrated with SPY and QQQQ by a hairbreadth only (two price series are called cointegrated if the pair has a consistent mean and standard deviation, both prices series never indefinitely wandering off in opposite directions and never drifting farther and farther away from its mean without eventually returning to the initial ratio or mean).

But the RTH doesn’t seem to be a favorable candidate for a longer-term (the half-life – the expected time to revert half of its deviation from the mean – is regualary measured in weeks or month) pairs trading strategy only, but may provide favorable short-term mean-reversion opportunities as well (market timing).

Table I below shows the performance metrics (since 06/01/2001 due to the RTH‘s inception in May 2001) for different pairs in conjunction with the RTH and – for demonstration puposes – different pairs of major market ETFs (SPY, QQQQ and IWM) and sector ETFs (XLY – Consumer Discretionary – and XLP – Consumer Staples -) based on an exemplary mean-reversion strategy, assumed one would’ve bought the pair (is equivalent to buying the first and selling short the second ETF in equal money amounts (number of shares in each ETF = 100% net asset value / share price)) on close of a session when the 4-day EMA (Exponential Moving Average) of the pair (the ratio of the closing prices) is less than the 4-day EMA of the ratio of closing prices for yesterday, and vice versa (selling short the first and buying the second ETF in equal money amounts in the event of a rising 4-day EMA of the ratio of closing prices).

Here is the link to the stats in a more ‘readable’, original size: Statistics 1

While – with respect to the specific setup defined – the SPY vs. QQQQ, the SPY vs. IWM, the XLY vs. XLP and the SPY itself (buy and hold) as a benchmark virtually went nowhere (or even closed in the red) over the course of the last 9 years – especially after accounting for fees and transaction costs -, the RTH as a pairs trading component in conjunction with the SPY, the QQQQ, the  IWM and the SMH not only easily out-performed a (S&P 500) buy-and-hold approach by a wide margin (and almost year by year as well, see ‘Periodic Returns‘ in the stats above), but comes up with a smoother equity curve as well, meaning there are much less dramatic departures from a gradually/geometrically increasing trendline (R-squared, maximum drawdown, maximum sessions in drawdown) in comparison to a SPY‘s buy and hold approach.

Interestingly the SPY vs. RTH and SMH vs. RTH pairs trading strategies and a S&P 500 buy-and-hold approach do NOT differ with respect to the probability of a winning trade (the probability is almost always slightly above 50% only). The reason for the deviation in total returns is the fact that – in contrast to the SPY‘s buy and hold approach – the median winning trade (+0.51%) now equals or slightly exceeds the median losing trade (-0.50% ), significantly improving the respective expectancy (probability of winning * average gain – probability of losing * average loss).

But a SPY vs. RTH‘s pairs trading strategy has another advantage as well: Chosing a slightly different setup in order to especially exploit those reversal opportunities where the pair is (from a historical and statistical perspective) exceptionally stretched to one or the other side would be sufficient to not only surpass previous compounded returns, but to cut in half the time in market and the maximium drawdown as well. Table II below shows the performance metrics (since 06/01/2001 due to the RTH‘s inception in May 2001) for the same pairs, assumed one would’ve bought the pair (buying the first and selling short the second ETF in equal money amounts) on close of a session when the pair (the ratio of the closing prices) closed at least -0.50% below its 4-day EMA, and vice versa (selling short the first and buying the second ETF in equal money amounts in the event of a close at least +0.50% above the 4-day EMA of the ratio of closing prices).

Here is the link to the stats in a more ‘readable’, original size: Statistics 2

With respect to SPY vs. RTH (Strat. #1), time in market and maximum drawdown have been exactly cut in half (giving you the chance to earn an additional return on cash) while the geometric growth rate per trade doubled. Although the probability of a winning trade (again) only slightly improved (from 54.63% to 57.44%), it is (again) the effectiviness (doing things right instead of doing the right thing only, meaning increasing your gains when you’re right and cutting your losses when you’re wrong) of the strategy which makes for the improvement in key performance metrics.

But what about the robustness of a SPY vs. RTH pairs trading strategy ? It it works with a -0.50%/+0.50% level below/above a 4-day EMA, it should work with a -/+0.30% up to a -/+0.70% level and a 3-day and 5-day EMA as well showing some gradual – no radical -  changes with respect to the key performance metrics only.

Table III below shows the performance metrics for the SPY vs. RTH pairs trading strategy, assumed one would’ve bought the pair (buying the first and selling short the second ETF in equal money amounts) on close of a session when the pair (the ratio of the closing prices) closed at least

  • Strat. #1: -0.30% below (long) and +0.30% above (short) its 4-day EMA,
  • Strat. #2:-0.40% below (long) and +0.40% above (short) its 4-day EMA,
  • Strat. #3:-0.50% below (long) and +0.50% above (short) its 4-day EMA,
  • Strat. #4:-0.60% below (long) and +0.60% above (short) its 4-day EMA,
  • Strat. #5:-0.70% below (long) and +0.70% above (short) its 4-day EMA.

SPY vs. RTH (Strat. #6) represents a buy-and-hold approach (assumed one would always be long the SPY and short the RTH).

Here is the link to the stats in a more ‘readable’, original size: Statistics 3

And last but not least, table IV below shows the performance metrics for the SPY vs. RTH pairs trading strategy, assumed one would’ve bought the pair (buying the first and selling short the second ETF in equal money amounts) on close of a session when the pair (the ratio of the closing prices) closed at least

  • Strat. #1:-0.50% below (long) and +0.50% above (short) its 3-day EMA,
  • Strat. #2:-0.50% below (long) and +0.50% above (short) its 4-day EMA,
  • Strat. #3:-0.50% below (long) and +0.50% above (short) its 5-day EMA.

SPY vs. RTH (Strat. #4) represents a buy-and-hold approach (assumed one would always be long the SPY and short the RTH).

Neither a slight variation in the percentage level below/above the 4-day EMA nor a variation in the duration of the EMA itself affects any of the strategy’s key performance indicators in a significant way, except – but expectedly – the so called opportunity factor (total number of sessions and time in market).

Summary: A SPY vs. RTH‘s pairs trading strategy, assumed one would’ve bought the pair (buying the SPY and selling short the RTH in equal money amounts) on close of a session when the pair (the ratio of the closing prices) closed at least -0.50% below its 4-day EMA, and vice versa (selling short the SPY and buying the RTH in equal money amounts in the event of a close at least +0.50% above the 4-day EMA of the ratio of closing prices), historically provided a (consistently) profitable market timing strategy (a median annual return of +15.65%), (consistently, in 8 out of the last 9 years) out-performing a S&P 500 buy-and-hold approach, with a smooth equity curve (R-squared, maximum drawdowns on a week/month/year end basis, maximum time in a drawdown), meeting at least basic requirements for robustness and reliability. Unfortunately a shortcoming is the deviation in yearly returns (one standard deviation = 32.72%).

A favorable basis for some further investigations and refinements (accounting for return on cash, position sizing, and making the strategy adaptiv to changing market conditions – if necessary).

to be continued …

Successful trading,
Frank

Remarks: Due to their conceptual scope – and if not explicitely stated otherwise -, all models/setups/strategies do not account for slippage, fees and transaction costs, do not account for return on cash, do not use position sizing (e.g. Kelly, optimal f) – they’re always ‘all in-, do not use leverage (e.g. leveraged ETFs) - but a marginable account is mandatory -, do not utilize any kind of abnormal market filter (e.g. during market phases with extremely elevated volatility) , do not use intraday buy/sell stops (end-of-day prices only), and models/setups/strategies are not ‘adaptive‘ (do not adjust to the ongoing changes in market conditions like bull and bear markets).

________________________________

If you might want to be instantly notified about what’s happening in the markets and at TRADING THE ODDS, I encourage you to subscribe to my RSS Feed or Email Feed, and (or) follow me on Twitter.

xx

Disclaimer: Long SMH and short XRT at time of writing.

The information on this site is provided for statistical and informational purposes only. Nothing herein should be interpreted or regarded as personalized investment advice or to state or imply that past results are an indication of future performance. The author of this website is not a licensed financial advisor and will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on the content of this website(s). Under no circumstances does this information represent an advice or recommendation to buy, sell or hold any security.

Add to Technorati Favorites


Pairs Trading (ETFs)

First of all thanks for your patience, and from now on I’ll be posting again on a more frequent basis.

And furthermore I’d like to advise those interested in quantitative research of a new blog I just came across: Engineering Returns by Frank Hassler.

____________________________________

Due to the fact that I’m a big fan of statistical arbitrage (and trading it for a living), I thought it would be interesting to check if – and to what extend – there are pairs of ETFs (Exchange Traded Funds) which – as always based on historical data, statistical anomalies, regularities and irregularities, … – would provide a favorable and tradable edge maintaining a market neutral position.

I personally prefer ETFs to individual stocks due to the fact that the latter are much more sensitive to unforeseeable events and/or outcomes like earnings, fundamentals, crew changes (CEO, CFO, …), rate disputes, strikes, take-overs, force majeure (casualties, disasters, …). And I speak from my own experience …

In conjunction with pairs trading, you’ll probably hear about two (quite different) concepts: correlation and cointegration.

Correlation states the degree to which the (daily, weekly, monthly …) returns of two series of prices (e.g. the S&P 500 and the Nasdaq 100) will move in the same direction most days/weeks/month over a period of time (but  probably drifting farther and farther away from each other due to deviations in the magnitude of daily returns), while a pair (being long one and short the other series of prices in the right proportion) is called cointegrated if it has a consistent mean and standard deviation, both prices series never indefinitely wandering off in opposite directions and never drifting farther and farther away from its mean without eventually returning to the initial ratio or mean (mean-reversion).

But – unfortunately – the so-called half-life (the expected time to revert half of its deviation from the mean) concerning a cointegrated pair of price series will regularly be measured in weeks or month (see stats below), and I’m more a high-frequency trader looking for opportunities on a day-by-day basis.

The following are the ETF’s I’ve been utilizing for my investigations, meeting the necessary requirements like adequate liquidity (daily trading volume), as low as possible transaction costs (narrow bid/ask spreads), adequate volatility (in order to justify the arising high transaction costs), among others:

  • SPY: S&P 500
  • QQQQ: Nasdaq 100
  • IWM: Russel 2000
  • SMH: Semiconductor
  • RTH: Retail

Other ETFs may be subject to a follow-up posting.

To test for cointegration, the primarily method used is called the augmented Dickey-Fuller test. If two price series are cointegrated (with a probability of better than 90%), the Dickey-Fuller test would’ve to come up with a t-statistic exceeding the 90% critical value of -3.038 (in absolute terms), otherwise the hypothesis that those two price series are conintegrated would be rejected. The following table provides the respective t-statistics based on the augmented Dickey-Fuller test for the time frame between 01/01/2002 and 08/06/2010 (price series are adjusted for dividend and cash payments).

t-statistic SPY QQQQ IWM SMH RTH
SPY - -0.8210 -2.7995 -1.8635 -2.8513
QQQQ - - -2.6115 -1.0084 -2.0935
IWM - - - -1.9626 -3.2206
SMH - - - - -3.3625
RTH - - - - -

Interestingly there are only two pairs – IWM vs. RTH (gt. 90%) and SMH vs. RTH (gt. than 95%) – which are cointegrated with a probability of better than 90%, while the SPY (as a proxy for the S&P 500) and the QQQQ (as a proxy for the Nasdaq 100) show the least probability for being cointegrated. IWM vs. RTH shows a half-life of 194 sessions, and SMH vs. RTH a half-life of 92 sessions. Both pairs seem to be good candidates for a (longer-term) mean-reversion strategy.

A second interesting observation is that even in conjunction with SPY and IWM, the RTH (Retail HOLDRS) seems to be a favorable candidate for a potential mean-reversion strategy.

But fortunately cointegration is not mandatory in order to find a profitable mean-reversion strategy, and on a day-by-day basis even non-cointegrated pairs (like the SPY vs. QQQQ) may provide favorable short-term mean-reversion opportunities (better fitting my style of trading). So my next step was to check for the pair’s performance based on the easiest mean-reversion strategy:

Buy (on close) the pair in the event the ratio of ETF X and ETF Y closed lower (means ETF A under-performed ETF B on the respective session), and sell short (on close) in the event the ratio of ETF X and ETF Y closed up (means ETF A out-performed ETF B on the respective session). Due to the RTH‘s inception date in 2001 start date for the following stats is always Jan. 1, 2002.

Buy” means buy ETF A and sell short ETF B (and vice versa), the number of respective shares specified by the ratio of closing prices (e.g. if the ratio of ETF A’s and ETF B’s closing prices is 3, one would sell short 3 shares of ETF B for every share bought of ETF A). A marginable account would be mandatory, especially due to the fact that it is assumed that one would invest 100% of the then current net liquidation value on both sides of the market (means 100% on the buy and 100% on the short side).

(FAQs and a glossary concerning the stats can be found at the FAQ/GLOSSARY page)

Here is the link to the stats in a ‘readable’ size: Statistics 1

Interestingly it is again the RTH in conjunction with every other ETF which delivers the best results, always exceeding the 200% mark for compounded returns (gross profits before applying commissions, slippage and fees). Unfortunately commissions, slippage and fees would regularly eat up a major part of the compounded return, due to the fact that one would always have a position in the market, with an exposure of 200% (100% on the buy and 100% on the short side), and reversing one’s position (switching from the long to the short side of the pair and vice versa) would quadruple the respective transaction costs in comparison to somone who simply closes a long or short position with an 100% exposure.

In a second step I utilized a little bit more sophisticated concept (Bollinger Bands %B with 4-days EMA and 1 standard deviation):

Buy (on close) the pair in the event the Bollinger Bands %B closed below 0.35, and sell short (on close) in the event the Bollinger Bands %B closed above 0.65.

For a detailed explanation of the Bollinger Bands %B concept see Stockcharts.com. In other words: Buy the pair in the event the ratio closed almost (< 0.35) one standard deviation below its 4-day exponential moving average (ETF A is short-term ‘oversold’ in comparison to ETF B), and sell short the pair in the event the ratio closed almost (> 0.65) one standard deviation above its 4-day exponential moving average (ETF A is short-term ‘overbought’ in comparison to ETF B). A classical mean reversion concept.

Here is the link to the stats in a ‘readable’ size: Statistics 2

Things are (partly) significantly improving: Compounded returns, t-score (vs. chance and benchmark) are increasing while transaction costs, maximum drawdowns are decreasing (now Time in Market is less than 100%, with a smaller frequency of closing or reverting one’s position), and especially the SPY vs. RTH and IWM vs. RTH pairs show promising results to be worth some further investigations.

More to come in a follow-up post (at time of writing it’s almost midnight in Germany) …

to be continued …

Successful trading,
Frank

________________________________

If you might want to be instantly notified about what’s happening in the markets and at TRADING THE ODDS, I encourage you to subscribe to my RSS Feed or Email Feed, and (or) follow me on Twitter.

xx

Disclaimer: No position in the securities mentioned in this post at time of writing.

The information on this site is provided for statistical and informational purposes only. Nothing herein should be interpreted or regarded as personalized investment advice or to state or imply that past results are an indication of future performance. The author of this website is not a licensed financial advisor and will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on the content of this website(s). Under no circumstances does this information represent an advice or recommendation to buy, sell or hold any security.

Add to Technorati Favorites

BLOGROLL

Twitter Feed

     SPY (S&P 500 SPDR.)

DISCLAIMER

The information on this site is provided for statistical and informational purposes only. Nothing herein should be interpreted or regarded as personalized investment advice or to state or imply that past results are an indication of future performance. Under no circumstances does this information represent an advice or recommendation to buy, sell or hold any security.

The author of this website is not a licensed financial advisor and will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on the content of this website, including the information that others post here.

While every effort will be made to provide complete, the most accurate and current information, none of the information on this site is guaranteed to be correct, and anything written here should be subject to independent verification. I make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to this blog or the information, analysis, statistics, or related graphics contained on the blog for any purpose.

I may or may not hold positions for myself, my family and/or clients in the securities mentioned here. Actions may have been taken before or after information is presented, and any opinions expressed in this site are subject to change without notice.

Please read the full ... DISCLAIMER

Archives