The ABC of Creating A Mean Reversion Strategy

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

The ABCs of creating a mean

reversion strategy
What is Mean Reversion (MR)?
Mean Reversion is also known as pullback trading. The idea is that a stock that has
made a strong move down in the last few days is more likely to bounce back up.
Another way of looking at this as a stock moves away from the average price, it is
more likely to bounce back to (and through that average).

Benefits/drawbacks of Mean Reversion


Some of the pros of MR strategies are they have short hold periods of 3 to 7 days.
They perform well during volatile times.

Some of the drawbacks of MR strategies are as follows. During low volatile times,
like we have now, they can stay mostly in cash which can be frustrating. They work
better without stops, meaning it is best to wait for the bounce. It can be really hard
to pull the trigger on trades because the charts often look ugly. For the longest time,
I had a note by my computer that said, “close your eyes and push the button.” Here
is a recent trade that I had to enter.

Goals/targets
When developing any strategy, you need to have goals or targets for that strategy.
The metrics I focus on are Compounded Annual Return (CAR), top five maximum
draw downs, top five maximum draw lengths, smoothness of equity curve and fit
with my other strategies.

For CAR, I look for returns between 20 and 35% per year. This is mostly influenced
by my trading universe.

For drawdowns, I am not looking for really low numbers. I avoid strategies with
drawdowns under 20% because I believe that they are setting a false expectation.
These strategies typically have low drawdowns because they got lucky and avoided
some bad trades. I tend be happy with a range between 20 and 35 percent. I know a
lot of people want CAR to be 2 times more than MDD. When you do find those
strategies understand that everyone else is looking for the same thing. By not caring
about having MDD greater than CAR, I am looking for strategies that others are
avoiding. Which is good.

For draw lengths, I want values of less than one year. It is harder to be not making
new equity highs then going through a steep but quick drawdown. This stat is
under-appreciated.

For smoothness of equity curve, I used to look for a nice looking equity curve. We
know what it looks like. It goes up in a nice steady line. About a year ago, I realized
that this is what everyone else is looking for and again it is probably a product of
good luck or avoiding bad luck in the trades. Now I try to avoid the really smooth
curves.

For fit, I want the strategy to complement my other strategies. I look at rolling 1-3
month correlation of the equity curve. I want values all over the place. I don’t want
the strategy to always be strongly correlated with another strategy I am trading.
When I combine the strategies, I want the overall drawdown and drawlengths to go
down.

These are what I focus on. Each person needs to decide what stats they will focus on
and the values they are looking for. These can include Sharpe Ratio, % winning
trades, Ulcer Index and many more.
Trading Universe
The selection of your trading universe will have the biggest impact on your strategy.
If you are looking for a high CAR strategy, you will not find it by trading S&P100
stocks. If you are looking for a low volatility strategy, then don’t trade those low
volume low priced stocks.

The trading universes I focus on are S&P100, S&P500 and Russell 3000. The one I
pick depends on my goals. For a higher CAR, I will focus on Russell 3000 stocks. For
lower volatility I will focus on S&P100 or S&P 500 stocks. For those of you with easy
access to foreign markets, these are also great places to trade if you can handle the
volatility. These markets have better MR results.

Beyond the universe, you need to decide on how little liquidity are you willing to
trade. I focus on average dollar-volume over the last month. If I plan to be trading
$10,000 per position, then I don’t want to be more than .5% of the dollar-volume.
Preferably even less. Meaning, I want the stock to be trading at least $2 million per
day.

The last part to consider is price. How low of price will you trade? Once you get
below $5, stocks tend to become much more volatile. Also depending on how your
commission structure is, going under $1 may be problematic. Say you pay
$.005/share for commission and you want to buy $10,000 of a $.50 stock. That comes
out to $100 in commission in and another $100 out for a total of $200. That is 2% of
your $10,000 and that is hard to make up.

How to measure daily mean reversion


So how do we determine if a stock has pulled back over the last few days? There are
lots of technical indicators you can use. Is one the best? No. Each one works and
there is a large overlap between them. Use the one that you like and get good results
with. Here are some that I have used. For AmiBroker users, I have provided a
download that has all these in it.
Relative Strength Indicator (RSI): There should be no surprise that this is the
first one I list since a good portion of my posts reference it. I use very short lengths
from 2 to 4 days. For example, 2 day RSI under 5 works well.

ConnorsRSI: Using the default values, I like to see values under (10,15). To learn
more about ConnorsRSI, see this post. A value of ConnorsRSI under 10 is a great
signal for pullback.
%B (percentB): %B is the closing price relative to the upper and lower Bollinger
Bands. A value of 1 is when the close is at the top band. A value of zero is the close
of the bottom band. See here for the calculation. My typical use a length of 5 or 10, a
standard deviation of 1.0 or 1.5 or 2.0. Then I filter for %b to below 0 or -.1 for one
to three days.
Moving average stretch: Here we want the closing price to be stretched below the
moving average. For example, the close is 5% or more below the 10-day moving
average. I like using the 5-day moving average and a close (3,4,5)% below it.
Rate of Change: How much has the stock sold off in the last N days. This is simply
close today divided by the close N days ago minus one. I typically look at (3,5,10)
days back. As to how much it has sold off, values between 5 and 15% work well.
Days down: This simple idea works quite well. The stock has closed (3,4,5) days
down in a row is a good sign of a pullback.
N-day low: The closing price is a (5,7,10) day closing low. You can compare against
the lowest low or the lowest close over the last N days. Again, simple but works
quite well.
Closing range: Where is the current close vs the high and low of the last (5,10,20)
days. The formula is (current close – lowest low of last N days)/(highest high of last
N days – lowest low of last N days). I like to see this value under (.10,.25).
Once you have chosen your indicator, you need to decide on what values to use. For
example, if you chose 3-period RSI, what values will be considered a pullback? The
smaller the value the more stretched the stock is and the bounce will likely be
bigger. But these trades happen less often. The value picked is often a trade off
between the number opportunities and how well they perform.

Combining MR Indicators
You don’t need to pick only one indicator from the above list. I often will combine
two of the together. There are two ways of doing this.
Confirming: The most common way I combine MR indicators is as confirmation.
For example, I will have 2-period RSI less than 5 and three plus days down closes.
With two indicators giving a signal, I feel more confident overall.
Stringent: The other method is two combine two indicators with very stringent
requirements and only require one to be true. For example, 2-period RSI less than 1
or three day rate of change under -10%. Each rule is not likely to trigger often but
together we may get more trades.

Last bar mean reversion

Besides a stock being over the last few days, I like to also see weakness on the last
bar. My two favorite methods are rate of change and closing range.

Rate of Change: What percent was the stock close to close move? I like to see
under minus 1 percent and even lower.
Closing range: Where is the current day’s range did the close happen? The formula
is (current close – low)/(high – low ). I like to see this value under (.10,.25). This is
also known as Internal Bar Strength.

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

You might also like