Market Technician, TradeStation Labs TSLabs@TradeStation.com Standard deviation is a common statistical calculation that is often used in the world of finance to measure risk. The higher the standard deviation, the higher the overall risk or volatility. However, standard deviation can also be used as a basis for mean-reversion trading strategies. In this Analysis Concepts paper, we will introduce a strategy and indicator that use standard deviation to calculate a z-score. A z-score is simply the number of standard deviations separating the current price from the mean price. The strategy then looks at the momentum of the average z-score and takes a contrarian approach to trading to generate buy and sell signals. If the z-score is positive, it means that the current price of the security is above its mean. Correspondingly, if the z-score is negative, the current price of the security is below its mean. In essence, plotting the z-score will generate a line that looks similar to the price data. See Figure 1 below for an example. Notice how closely peaks and troughs in the average z-score match peaks and troughs in the price data.
The next part of the strategy applies the momentum indicator to the average z-score. Taking a contrarian perspective, if the average z-score momentum is positive, the strategy sells short. If the average z-score momentum is negative, the strategy will go long. As might be expected with a contrarian strategy, the strategy generates more winning trades than losing trades, though the average losing trade is larger than the average winning trade. The strategy is likely to perform better in oscillating (trading range) markets than in trending markets. The indicator will plot both the average z-score and the average z-score momentum. The momentum is plotted as a histogram. Notice in Figure 2 below that when the momentum is positive, the histogram is red. When momentum is negative, the histogram is green. Figure 2 also displays strategy sample trades. When the average z-score momentum changes from negative to positive, the strategy will sell short, whereas when it changes from positive to negative, the strategy will buy. The strategy and indicator are meant to be used on a daily interval. As demonstrated here, the strategy is applied to various major market ETFs, particularly the S&P Depository Receipts (SPY). Strategy Style Asset Type Traded Symbol Data Interval Period Tested Short Term Stocks SPY - S&P Depository Receipts Daily 18 years
Buy or buy to cover when the momentum of the average z-score is negative. Sell short or sell when the momentum of the average z-score is positive. Name Default Description Length 10 MomLen 5 Length used to calculate standard deviation, average price, and average z-score. Length used to calculate momentum of the average z- score. There are two inputs in both the strategy and the indicator; both are lengths used to calculate all of the variables. The first input, Length, is used to calculate the majority of the variables, including the standard deviation of the closing price, the exponential average of the closing price, and the exponential average of the z-score. The second input, MomLen, is the length used to calculate the momentum of the average z-score. In this case, the default lengths used are 10 and 5. Sensitivity analysis was conducted on both inputs to make sure that the inputs chosen were not corresponding to a peak profit. The z-score is one of the basic tenets of a normal distribution and is often used in conducting statistical analysis. The further from zero the z-score, the further the current price is from its mean. Using a contrarian or mean-reversion strategy, you would take a position opposite the current z-score. If the z-score is positive (the current price of the security is above its mean), the strategy will take a short position. If the z-score is negative (the current price of the security is below its mean), the strategy will take a long position. As an additional filter, strategy signals are generated based on the momentum of the average z-score, not on the average z-score itself. A key to generating extremely efficient trades is the inflection points or turning points of the average z-score. Using the five-day momentum helps identify short-term turning points in the security s price movement. Because this is a mean-reversion strategy, it performs better in oscillating markets than in trending markets. See Figure 3 below for a highlighted example of accurate and efficient trades during an oscillating market. While the strategy is designed to generate both long and short entries, it may be used as a long-only strategy.
In this paper, we present the results of the strategy as applied to the S&P Depository Receipts. However, this strategy can be applied to various major markets ETFs as presented in the Portfolio Spotlight section.
Symbol Description K-Ratio RINA Index Buy and Hold Return Return on Account XLF S&P Sel Financial Spdr Fund 2.52 51.84-38.30% 617.09% XLE S&P Sel Energy Spdr Fund 2.79 42.18 179.27% 484.52% MDY S&P Midcap Dep Receipts 2.51 40.42 124.63% 321.78% KBE SPDR Series KBW Bank 4.39 36.50-57.41% 735.72% IWB ishares Russell 1000 Index Tru 3.01 28.31-15.01% 468.11% IWP ishares Russell Midcap Growth 2.99 19.79 56.67% 304.75% Return on Initial Capital 185.15% Buy-and-Hold Return 173.28% Return on Account 781.06% Annual Rate of Return 5.89% Profit Factor 1.36 Avg Monthly Return $202.95 Std. Deviation of Monthly Return $660.94 Net Profit / Maximum Drawdown 6.27 Weekly Underwater Equity -17.39% Buy-and-Hold Weekly Underwater Equity -55.90% K-Ratio 3.03 RINA Index 58.66 The return on account of 781.06% over the approximately 18 years that the strategy was backtested far exceeded the buy-and-hold return of 173.28% (buying at the beginning of the testing period and holding the security). The K-ratio, which is a risk-adjusted performance measure, is 3.03. The higher the K-ratio, the better the strategy in terms of risk-adjusted performance. The industry standard is 2.50. The weekly underwater equity of the strategy, -17.39%, is much better than that experienced under the buy-and-hold strategy for the security, -55.90%. Average profit by month was positive 10 of the 12 months, with November being the worstperforming month. The detailed equity curve is fairly linear over the 18 years that the strategy was back-tested. The strategy was back-tested over the entire period during which the security was tradeable. Risk-adjusted performance is consistent across several ETFs, as presented in the Portfolio Spotlight table. The net profit divided by maximum drawdown ratio was 6.27, signifying low drawdown during the back-test.
Because the strategy is a mean-reversion strategy, it performs better in oscillating markets than in trending markets. The strategy has a smaller average winning trade, $168.27, than average losing trade ($214.21). The standard deviation of monthly return is 326% times the average monthly return, signifying higher risk in the strategy. The strategy has a high number of maximum consecutive losing trades (6). In this Analysis Concepts paper, we introduced a mean-reversion strategy that uses the concept of the z-score and momentum to generate buy and sell signals. The z-score can be used to identify periods when an asset s price has deviated from its average. As mentioned earlier, the strategy is likely to be most effective during oscillating rather than trending markets and has more of a short-term outlook. Strategy results are consistent across various major market ETFs, which allows you to use the strategy across a wide range of securities. Considering that the strategy s losing trades tend to be larger than its winning trades, the addition of money-management rules may provide a higher profit factor, as the losing trades would be exited sooner. Overall, the strategy uses two simple concepts standard deviation and momentum to create a short-term mean-reversion strategy. The strategy is not likely to be very effective in a long-term bear or bull market when the trend is extremely strong. However, if the trader is able to identify periods of higher volatility and oscillating markets, the strategy may indeed lend itself to generating satisfactory risk-adjusted returns. An interesting variation to this strategy might include an additional filter, such as the ADX, to allow trades to be generated only when the security is not exhibiting a strong trend. To use the files provided with this issue of Analysis Concepts Reports: Files with extension.eld These contain EasyLanguage documents: analysis techniques and strategies. Double-clicking on this file will start the Easy Language Import Wizard. Follow the prompts to completion. The analysis techniques or strategies will automatically be placed in the correct locations for your use in TradeStation. This should be done before opening any workspaces provided. Files with extension.tsw These are TradeStation workspaces. These may be stored in any folder where you choose to save TradeStation workspaces. Files with extension.txt These are text versions of the EasyLanguage documents and are generally used only by advanced EasyLanguage users. Other supporting documents or files may also be attached to the report. All support, education and training services and materials on the TradeStation Securities website are for informational purposes and to help customers learn more about how to use the power of TradeStation software and services. No type of trading or investment advice is being made, given or in any manner provided by TradeStation Securities or its affiliates. This material may also discuss in detail how TradeStation is designed to help you develop, test and implement trading strategies. However, TradeStation Securities does not provide or suggest trading strategies. We offer you unique tools to help you design your own strategies and look at how they could have performed in the past. While we believe this is very valuable information, we caution you that simulated past performance of a trading strategy is no guarantee of its future performance or success. We also do not recommend or solicit the purchase or sale of any particular securities or derivative products. Any symbols referenced are used only for the purposes of the demonstration, as an example ---- not a
recommendation. Finally, this material may discuss automated electronic order placement and execution. Please note that even though TradeStation has been designed to automate your trading strategies and deliver timely order placement, routing and execution, these things, as well as access to the system itself, may at times be delayed or even fail due to market volatility, quote delays, system and software errors, Internet traffic, outages and other factors.