- in General , Mean Reversion by Cesar Alvarez
The ABCs of creating a mean reversion strategy – Part 2
This post is the continuation of the steps for creating a mean reversion strategy from the first part of The ABCs of creating a mean reversion strategy – Part 1. You can also listen to part 2 of my interview on Better System Trader here.
A quick recap of the topics covered in part 1. I covered trading universe, indicators to measure daily mean reversion, combining multiple mean reversion indicators, and last bar mean reversion.
Other Filters
Besides indicators filtering for a pullback, you can have other filters. I use the close above the 200-day moving average as signal of a healthy stock. Trading below the 200-day moving average works but comes with additionally volatility and much bigger losers.
Two more filters I use are 10-day ADX and 100-day Historical Volatility. These can be used in two ways. Filtering for values above 40 or values below 40. This depends if I am looking for volatile stocks or trying to avoid them. Avoiding them reduces drawdowns but also reduces returns.
Typically, I try to limit a strategy to two mean reversion indicators and three other indicators.
Market Regimes
Creating a strategy that works in all types of markets is difficult. Two methods for a regime filter are moving average based and volatility based.
Moving average: Using the 200-day moving average of the S&P500 index to define our regimes as bull when the market is above it and bear when it is below it is a good method.
Volatility based: Here you can use the 100-day historical volatility of the S&P500 index and then use a cut off value. When above this value, the market is in high volatility environment and when it is below it is in a low volatility environment. We can also use the VIX to determine the regime. There are many other ways to measure the market volatility.
You can also combine the two above to create multiple regimes. You need to be careful about creating too many regimes because some may not have very many trading days.
Once you have your regime, for example using 200-day MA, then you must decide what to do in each regime. For a bull market, this is when the strategy trades normally. For a bear market, the strategy can go 100% in cash, or reduce position size by 50% or trade different values for your filters such that your rules are more stringent.
Ranking of signals
When the strategy has more signals than it can trade, how do you rank them? For mean reversion, the two best rankings I have found are 100-day Historical Volatility (ranking from high to low) and Rate of Return (3,5,7 day) ranking from most sold off to least. Other methods that work are using the mean reversion indicator from the buy rule. For example, if the strategy uses RSI2 as an entry then we use RSI2 to rank the signals from low to high. How you rank can have a large impact on your results but people rarely spend much time deciding this.
Position Sizing
Now that we have a signal, how much capital does the strategy allocate per trade? Two common methods are fixed percentage and volatility based. My preferred method is allocating the same percentage per position. Through all my testing, trying different types of position sizing has rarely had much change in the results and definitely not enough on the positive side to justify the additional complexity. At the end of the day, I prefer simpler rules.
Now given that, some people will prefer to use volatility based sizing. This is where the volatility of the stock is used to adjust the position sizing. Where more volatile stocks are allocated less capital than less volatile stocks. For some people this makes more sense to do this way. You want to have rules that will make it likely you will follow your strategy. Even if that rules complicates the strategy or lessens the results.
Risk per trade
For mean reversion strategies, they rarely have a stop which makes this calculation difficult. I control my risk by the amount allocated to the strategy and the percent per position. I then ask myself, what would I do if I woke up one morning and a stock I owned opened down 50%. If that would cause me to break my rules, then I have too much allocated. If you are trading smaller cap stocks, I can guarantee you this will happen to you.
Number of positions
This particular strategy rule is rarely discussed. This is more important when using fixed percentage sizing. How many positions will the strategy take? Five positions at 20% allocation each? Twenty positions at 5% allocation each? With less positions, the strategy is subject more to luck, both good and bad. Meaning one good luck trade can have a large positive impact on the results. Of course, one bad luck trade can have a large negative impact on the results. When doing an optimization run (between 5 and 20 max positions), you will notice that the 5 positions runs will tend to show up more having the highest CAR but they will also show up more having the lowest CAR. The highest CAR benefited from good luck while the low ones from bad luck. I tend to go with 10 positions with 10% allocation. I will go with 5 positions with 20% allocation if I am trading bigger cap stocks.
Entry
There are two basic ways of entering the signal. At the open or at a limit price below the previous day’s close. Entering at the open has the benefit of knowing you will enter the trade. But this type of entry tends to have smaller returns than entering on a limit.
With a limit entry below the previous day’s close, you want the stock to continue the sell off a little more. These entries produce bigger winners but at a cost of not getting filled often. I find that low volatility environments like we have now make this type of entry hard to trade because fills become a lot less frequent.
For balance, I trade both methods.
Scaling-in
Should you add to your position? One approach that I have research extensively is waiting for a close below your entry price. While scaling-in may greatly improve your % winners it comes at a cost of reducing your returns. For me it is not worth it. But if you must have a high % winners in your strategy, I strongly suggest you look at scaling-in.
Exits
Now that the strategy is in a position. How is it going to exit? Some combination of the below will produce a good exit strategy.
Indicator based: This exit by itself will give the best returns. I will use the same indicator that measured the mean reversion to get out of the position. If I used RSI2 under 10 to get in, I would then use RSI2 over 50 to get out. Sometimes I will use a different mean reversion indicator to get out. If I used RSI2 to get in, I can also use a close above the 5 day moving average to get out. In general waiting for the stock to bounce produces the best results. The problem is sometimes it takes a very long time to bounce. It is hard to hold onto a stock that is going down day after day.
Maximum stop loss: I have written before about using this type of exit on this post, Maximum Loss Stops: Do you really need them?. On the rare occasion that I use this type of stop, it tends to be quite large at around 20 to 25%. The main reason to use this stop is that it psychologically helps you trade the strategy.
Trailing stop: I have never managed to get this type of stop to work. Meaning when I try adding this to a strategy it greatly reduces returns and make drawdowns worse.
Scaling out: Scaling-out is selling part of your position when the stock bounces and then either having a trailing stop or waiting for it to become overbought for exiting the rest of the position. For example, sell half the position on RSI2 above 30 and then the other half when RSI2 is above 70. I really like this idea but like other good ideas, I could not produce good results from it. I have tried both using intraday exit and end of days.
Profit target: Using a profit target on mean reversion trades simply cuts your profit. Letting the bounce fully happen is best. Again, another idea that I have not had success with.
Bar based: On a bar based exit, the trade is exited after being in it for X trading days. Since most winning mean reversion trades exit by 7-10 days, this tends to be a good value to use. This is one of my favorite non-standard exits to use. Even though this will reduce returns slightly, the psychological benefit of not being in a trade that goes down day after day for a several weeks is worth it for me. If you have not tried this type of exit before, I highly recommend it.
For my strategies, I typically will use an indicator exit and a bar exit combined. Even though, I have not had success with trailing stops, scaling out and profit targets, if using these exits gives you the psychological advantage of sticking to your strategy then think about using them.
Final Thoughts,
Even though I gave no specific rules, you should be able to build your mean reversion strategy using the steps outlined in this post and the previous one. Most these steps are necessary for any strategy. But what works or does not work for a mean reversion strategy may not work for another type of strategy like breakouts or trend following.
On this post, Simple ConnorsRSI Strategy on S&P500 Stocks, you can see most of the ideas discussed being applied to a strategy.
Backtesting platform used: AmiBroker. Data provider: Norgate Data (referral link)