MR Swing: A quantitative system for mean‐reversion and swing trading in market regimes March 2010 David Abrams Scott Walker Quantitative System Designer Portfolio Manager www.daveab.com www.walkertradingpartners.com [email protected] [email protected] 1. Abstract MR Swing is a quantitative system that employs daily mean‐reversion and swing trading in different market regimes to produce enhanced absolute and risk adjusted returns (e.g. in one configuration 23% CAGR, 54% risk adjusted CAGR, 1.37 Sharpe, 13% max drawdown). The system uses four key design principles: market‐regime‐switching, non symmetrical trading algorithms, volatility adaptive metrics, and robustness to regime whipsaws. An extensive analysis of out‐of‐sample ETFs and managed futures demonstrates the robust performance of the system over ten years. Finally, MR Swing is incorporated as a component in a diversified portfolio of ETFs (modeled after university endowments) and is shown to significantly increase the portfolio’s return while reducing the maximum drawdown. 1 This paper describes a quantitative method for trading equity indexes (ETFs and futures) that can increase return and reduce volatility when used in a diversified portfolio. The system is designed to be adaptive to changes in market volatility over the short‐term, and also deploys techniques aligned to the dominant market regime. After recapping the robust performance metrics across various ETFs and futures, we demonstrate how MR Swing improves the performance and risk profile as a component in a portfolio with asset class allocations inspired by large university endowments: The Ivy Portfolio (Faber and Richardson 2009). The MR Swing system is based on four core principles: (1) Market‐regime‐switching, (2) Non symmetrical trading algorithms, (3) Volatility adaptive metrics, and (4) Robustness to regime whipsaws. The first principle is market‐regime‐switching. Markets behave differently in different environments. We quantify the current market environment or regime, and then adopt a trading approach best suited to it. An example of regime switching (Kestner 2003) uses a trend‐following method (the 40‐day/20‐day channel breakout) in trending markets, and counter‐trend trading (14‐day relative strength index (RSI)) in non‐trending markets. The average directional index (ADX) is used to define the market regime as trending or non‐trending. Table 1: Example of Regime Switching (Kestner 2003) ADX < 20 trend to begin soon 40‐day/20‐day channel breakout 20<ADX<30 mean‐reversion in prices 14‐day RSI strategy ADX>30 trending prices 40‐day/20‐day channel breakout In MR Swing we simply quantify two regimes: bull and bear. One could have more complex regimes based on price volatility, option implied volatility, and other factors. We use a short‐term mean‐ reversion method in the bear regime, and swing trading technique in the bull regime. The second principle is non symmetrical trading algorithms. Most trading strategies simply reverse the rules for bull and bear. For example, in Tactical Equity Allocation Model (T.E.A.M.) the system (Lent 2 2009) buys short‐term mean‐reversion on a daily time‐fame, when the weekly percent trend channel has had an upside breakout. The system reverses these rules to short a rally in the daily timeframe after a weekly channel breakdown. Most counter‐trend systems pick one overbought/oversold oscillator and then symmetrically buy oversold and short overbought. These common techniques assume that markets behave in a symmetrical manner in different market regimes. We show that entirely unique techniques are more responsive to regime conditions rather than using symmetrical techniques. The swing trading component uses different algorithms for entries and exits. In addition, we employ different methods based on the regime to make a non symmetrical algorithm. Our third principle of volatility adaptive metrics requires that each individual component of the system must be capable of robustly handling changes in market volatility. For example, when we quantify the dominant market regime using a trend‐following method, we employ a channel based on price to reduce whipsaws and get the benefits of hysteresis. Next, every metric we use for mean‐reversion and swing trading entries/exits was carefully chosen to include volatility in the algorithm. In the mean‐ reversion component, the overbought/oversold levels are calculated using an adaptive technique that normalizes the data using nonparametric statistics (i.e. we do not assume that prices exhibit a Gaussian distribution). The final principle is robustness to regime whipsaws. Regardless of the method we use to define the current market regime, false alarms or whipsaws will occur. Classic moving average trend‐following systems are very prone to losses in a sideways market. Instead of trying to eliminate whipsaws in the regime model, we instead structure each component to be able to withstand whipsaws. That means, an entry in the swing trading regime must be able to handle a change to the mean‐reversion regime without causing the system to become unstable. MR Swing is designed to address these cases and ensure robustness to changes in regime, including whipsaws. 3 2. MeanReversion in Equity Indexes The major equity market indices exhibited daily follow‐through last century, but have been very much in a mean reverting environment since about 2000. Stokes showed (Stokes 06/09/2009 and 08/10/2009) how daily follow‐through worked well 1950 to 2000, but then it reversed. We suggest that this change to mean‐reversion is due to the increased speed at which news and data is priced into the market. In particular, computerized trading, discount brokers with low‐cost commissions, and the world‐wide‐web started to reach critical mass around 2000. These factors may have structurally changed how the indices behave and are reflected in our system design. In the study below, we compare daily follow‐through to daily mean‐reversion in the S&P 500 equity index. The rules for follow‐through are simple: if today’s close is higher than yesterdays, then go long. If it is lower than yesterday then reverse and go short. Daily mean‐reversion is the opposite. Algorithm 1: Daily Follow‐Through Rules Algorithm 2: Daily Mean‐Reversion (MR) Rules if (C > C ) then buy if (C > C ) then sell short 1 1 if (C < C ) then sell short if (C < C ) then buy 1 1 The results of these two systems over the last ten years are shown below. Table 2: Comparing Daily Follow‐Through to Daily Mean‐Reversion $100,000 portfolio from 10/01/2000 to 02/01/2010 System CAGR Sharpe Portfolio Max Max Profit Percent Max DD Value Wins Losers Factor Profitable Daily Follow‐ ‐16.20% ‐1.01 $19,097 7 9 0.82 33.67% 87.30% Through Daily Mean‐ 15.42% 0.78 $383,899 9 7 1.25 66.17% 26.13% Reversion As you can see, daily mean‐reversion has been a respectable system over the last ten years with 15.42% compound annual growth rate (CAGR) and 66% of trades profitable with a reasonable drawdown of 26%. The chart below compares the growth of a $100,000 portfolio trading the two systems between 2000 and 2010. 4 Figure 1: Daily Mean Reversion vs. Daily Follow Through $500,000 $450,000 $400,000 $350,000 $300,000 $250,000 $200,000 $150,000 $100,000 $50,000 $0 Daily Follow Through Daily Mean Reversion We will delve deeper into mean‐reversion and identify ways to improve on the base system. The benchmark for our system is the daily mean‐reversion system because of its simplicity and performance metrics. The system that we design must improve on the simple daily mean‐reversion shown above in order to justify the added complexity. 2.1. MeanReversion in Market Regimes We define market regimes based on a 200‐day simple moving average. We choose a 200‐day moving average based on research done by (Siegel 1998) that showed over the last century a 200‐day moving average filter would have reduced volatility in a long‐term stock portfolio. (cid:2020) (cid:3404) ∑(cid:3263)(cid:3284)(cid:3128)(cid:3127)(cid:3116)(cid:3117)(cid:3004)(cid:3284) where N = 200 (cid:2028) (cid:3404) (cid:1835)(cid:1832)(cid:1832)(cid:4666)(cid:4666)(cid:1829) (cid:3408) (cid:2020) (cid:4667),1 ,(cid:3398)1 (cid:4667) (Algorithm 3) (cid:3004) (cid:3004) (cid:3015) (cid:2028) (cid:3404) 1 (cid:1854)(cid:1873)(cid:1864)(cid:1864) (cid:1870)(cid:1857)(cid:1859)(cid:1861)(cid:1865)(cid:1857) (cid:2028) (cid:3404) (cid:3398)1 (cid:1854)(cid:1857)(cid:1853)(cid:1870) (cid:1870)(cid:1857)(cid:1859)(cid:1861)(cid:1865)(cid:1857) 5 Below shows the results of mean‐reversion in bull and bear market regimes. Table 3: Daily Mean‐Reversion (MR) in Market Regimes $100,000 portfolio from 01/05/1999 and 02/12/2010 System CAGR CAGR Sharpe Portfolio Time in Max Max Profit Percent Max DD risk adj Value Market Wins Losers Factor Profitable MR in 0.69% 1.30% ‐0.09 $108,346 53% 11 7 1.03 65.36% 21.62% Bull MR in 11.89% 28.80% 0.72 $348,498 43% 12 5 1.40 66.02% 26.14% Bear Daily mean‐reversion is a more dominant force during a bear market (11.89% CAGR, 0.72 Sharpe) compared to bull markets. Mean‐reversion thrives on the heightened volatility of bear markets. Figure 2: Mean Reversion in Market Regimes $400,000.00 $350,000.00 $300,000.00 $250,000.00 $200,000.00 $150,000.00 $100,000.00 $50,000.00 $0.00 MR in Bull Regime MR in Bear Regime The MR Swing system will be designed to take advantage of the outperformance of mean‐reversion in the bear regime, and we will use a different strategy in bull regimes. 6 3. Quantitative Trading System While we used data analysis in the previous sections to understand market structure for our system, it is important to avoid curve fitting when designing a quantitative trading system (Bryant 2006). In particular, we start with these guidelines: • Default parameter settings: all indicators and system components should use default values, instead of optimizing them for the highest net profit. • Avoid optimization: optimization will only be used to test if a system component adds value, not to choose specific settings. • Long Timeframe: we choose the last ten years as our timeframe. This gives us enough data for a robust analysis, and also keeps us trading the current market, and not last century’s market. • Many Trades: trend‐following system that only trade a few times per year may have drastically different results if you miss a small sample of trades. We prefer a system that generates many trades (e.g. MR Swing generates ~400 trades in the current analysis) because this adds to our confidence that system results are not overly influenced by a small set of trades. • Out‐of‐Sample Testing: we originally designed the system for the SPY, and will show the out‐of‐ sample results on the QQQQ, EEM, EWM, VTI as well as the futures @ES and @NQ. Our system design starts with the core principles outlined in the introduction: (1) we exploit different characteristics of markets by using a market‐regime‐switching method to take advantage of short‐term mean‐reversion in the bear regime, and deploy swing trading in the bull regime. Next, we will employ (2) non symmetrical trading algorithms for entries, exits and the regime specific trading algorithms. Every system component must be based on (3) volatility adaptive metrics so that it can handle changes in volatility over a long time span. Finally, we recognize that no regime switching model will be able to 7 eliminate all false signals and each core system component must exhibit (4) robustness to regime whipsaws. 3.1. Quantifying Market Regimes There are many ways to define the market regime. A complete study of different market regimes is beyond the scope of this paper. MR Swing identifies market regimes based on a 200‐day moving average channel of the highs and lows. When the system is in the bull regime, it only allows the channel to increase, and vice versa in bear. The reason we choose a channel over just a moving average is to get the benefits of hysteresis (Alves 2009) and reduce whipsaws by using a range of values before switching from bull to bear regime. Hysteresis (Hysteresis 2010) is a natural phenomenon that appears in magnetism, elastics, cell mitosis and control theory (e.g. thermostats). These systems exhibit path dependence in which the current state depends on the path taken to achieve it. The system has memory and the effects of the current input are only felt after a delay or range threshold is exceeded. We believe that markets also need time to respond to new information and that response does take into consideration recent market history. Our market regime filter requires price to close below the low of the channel before switching into a bear regime. Algorithm 4: Moving Average Trend Channel (cid:2020) (cid:3404) ∑(cid:3263)(cid:3284)(cid:3128)(cid:3127)(cid:3116)(cid:3117)(cid:3013)(cid:3284) (cid:2020) (cid:3404) ∑(cid:3263)(cid:3284)(cid:3128)(cid:3127)(cid:3116)(cid:3117)(cid:3009)(cid:3284) (cid:3013) (cid:3009) (cid:3015) (cid:3015) (cid:2025) (cid:3404) (cid:1835)(cid:1832)(cid:1832)(cid:4666)(cid:2028) (cid:3404) 1,MAX(cid:4666)(cid:2020) ,(cid:2025)(cid:4667),(cid:1839)(cid:1835)(cid:1840)(cid:4666)(cid:2020) ,(cid:2025)(cid:4667)(cid:4667) (cid:3013) (cid:3009) (cid:2028) (cid:3404) (cid:1835)(cid:1832)(cid:1832)(cid:4666)(cid:1829) (cid:3408) (cid:2025),1,(cid:3398)1(cid:4667) default N= 200 Simple moving average channel of the bar highs and lows. A bar close below the trailing channel ρ switches it to a down trend (τ = ‐1). In an uptrend (τ = 1) we only allow ρ to increase, such that in sideways market or retracement ρ does not change. 8 The market regime model shown below in Figure 3 is from 2005 to 2010 on a daily chart of the SPY. Figure 3: Market Regime Trend Channel on SPY from 2005 to 2010 200‐day SMA channel of bar highs and lows (increment only in direction of the trend). This technique captures the major market trends with fewer whipsaws than using the traditional 200‐ day SMA. Instead of attempting to design a long term market regime filter that removes all whipsaws, we require each component to exhibit (4) robustness to regime whipsaws in the core trading algorithm. A key design in the algorithm is not to exit a position just because the dominant market regime changed. Instead, we hold on to the position, and simply change the entry/exit rules based on the new regime. The mean‐reversion and the swing components must be able to handle this behavior without a serious drawdown. This is one reason the system structure is designed for major equity market indexes as opposed to individual (especially illiquid) equities, which may have a price shock due to a stock specific news announcement. MR Swing’s patience in waiting for a high probability exit to the trade after a regime change has been extensively tested and shown to greatly improve in the equity curve. 9 3.2. Bear Regime: Shortterm MeanReversion (MR) We can improve on the daily mean‐reversion system in section 2 by employing an adaptive short‐term mean‐reversion algorithm. Some quantitative systems have used a two period relative strength index RSI(2) for daily mean‐reversion. Although this would work fine in MR Swing, we choose the DVO (David Varadi Oscillator, 2009) because it meets our principle of a (3) volatility adaptive metric. The Percent‐ Rank function is used to normalize the daily data, and this nonparametric technique robustly adapts to market volatility changes. Algorithm 5: Generalized DVO and DV2 (cid:3015)(cid:2879)(cid:2869) (cid:1829) (cid:3036) (cid:2016)(cid:4666)(cid:2205)(cid:3365),(cid:2201)(cid:3364),(cid:1840)(cid:4667) (cid:3404) (cid:3533)(cid:4670) (cid:4671)(cid:1499)(cid:1871) (cid:4666)(cid:1834)(cid:1875) (cid:3397)(cid:1838) (cid:1875) (cid:3397)(cid:1841) (cid:1875) (cid:3397)(cid:1829)(cid:1875) (cid:4667) (cid:3036) (cid:3036) (cid:2868) (cid:3036) (cid:2869) (cid:3036) (cid:2870) (cid:3036) (cid:2871) (cid:3036)(cid:2880)(cid:2868) (cid:3015)(cid:2879)(cid:2869) (cid:2871) (cid:1875)(cid:1860)(cid:1857)(cid:1870)(cid:1857) (cid:3533)(cid:1871) (cid:3404) 1 (cid:1853)(cid:1866)(cid:1856) (cid:3533)(cid:1875) (cid:3404) 1 (cid:3036) (cid:3037) (cid:3036)(cid:2880)(cid:2868) (cid:3037)(cid:2880)(cid:2868) (cid:2160)(cid:2178)(cid:2171)(cid:4666)(cid:2205)(cid:3365),(cid:2201)(cid:3364),(cid:1840),(cid:1839)(cid:4667) (cid:3404) (cid:1842)(cid:1857)(cid:1870)(cid:1855)(cid:1857)(cid:1866)(cid:1872)(cid:1844)(cid:1853)(cid:1866)(cid:1863)(cid:4666)(cid:2016)(cid:4666)(cid:2205)(cid:3365),(cid:2201)(cid:3364),(cid:1840)(cid:4667),(cid:1839)(cid:4667) (cid:1856)(cid:1857)(cid:1858)(cid:1853)(cid:1873)(cid:1864)(cid:1872) (cid:1840) (cid:3404) 5 (cid:1853)(cid:1866)(cid:1856) (cid:1839) (cid:3404) 252 (cid:2160)(cid:2178)(cid:2779) (cid:3404) (cid:2160)(cid:2178)(cid:2171)(cid:4666)(cid:4670)0.50.500(cid:4671),(cid:4670)0.50.5000(cid:4671),5,252(cid:4667) The David Varadi Oscillator (DVO) was designed (Varadi 07/29/2009) to be a short‐term oscillator using bar highs and lows (maximum smoothing period N=5). The DV2 is one specific setting originally designed for the SPY (the weighting period was 50/50 over the last two days). The DVO can be used to create unique weighting schemes that function best for each class of security and define a local weight density ((cid:2205)(cid:3365) (cid:2201)(cid:3364)(cid:4667)for the ETF or futures contract. It captures different cycle lengths, amplitudes, and return distributions of the security. The DVO gives us the flexibility to customize the system to the different cycle lengths, amplitudes and return distribution of the particular security. Although we use the default values of the DV2 shown above, MR Swing’s performance could be improved using this readily available feature of the DVO. The chart below shows the DVO in the mean‐reversion component of MR Swing between 02/2008 and 08/2008. The system buys the next day open when DVO is less than 40% and shorts the next day open when DVO is above 70%. The magenta line above shows the market trend channel. 10
Description: