Last Updated on 12 June, 2021 by Samuelsson
The chances of your trading system making consistent returns over the long term depend on it trading in the right market environment and staying out when the market conditions are unfavorable. So, when trading stocks, you want to be buying when the overall market is bullish and not when it is bearish. To know when the conditions are right for your trading system, you need an efficient way to filter the market regime. Now, you may be wondering: what is a regime filter in trading?
A regime filter is a method a trader uses to determine the market regime to know whether or not to be in the market or move to cash in order to avoid unnecessary and avoidable drawdowns. Being able to determine the current market regime allows the trader to adjust his trading rules to suit the prevalent market situation so as to maintain his trading edge, regardless of whether the market is bullish or bearish.
In this post, we will discuss the topic under the following subheadings:
- What is a market regime filter?
- Understanding the use of a regime filter in trading
- Why you need to add a regime filter to your trading system
- The indicators you can use for a regime filter
- How to apply a regime filter in your trading system
- The pros and cons of using a regime filter in your strategy
- Tips for choosing a reliable regime filter for your trading system
What is a market regime filter?
A regime filter is a method a trader uses to determine the market regime to know whether or not to be in the market or move to cash in order to avoid unnecessary and avoidable drawdowns. But what is a market regime?
To put it simply, a market regime is a term used by algo traders to describe the condition of the overall market as regards whether the market is rising or falling. Market regimes are more about long-term, persistent states of the market that can be used for making investments or trading decisions. Hence, the market regime today does not depend solely on what happens in the market today but also on the days, weeks, and months preceding and succeeding it.
Since markets are adaptive systems, it is important to understand regimes — how they come about and how to identify them. We know that market regimes are tied to changes in the economic environment, which influence business preferences for different cash flow profiles. So investors often respond dynamically to changes in the economic environment, as these changing preferences are key drivers for stock prices.
Being able to determine the state of the market at every moment allows the trader to know which action to take in the market. If it’s a trader who plays only the long side, he would know when the general market is in a bearish mood so as to stay out of the market and move to cash or Treasury bonds. Buying in a bear market, such as the 2008 bear market, can easily turn a supposedly profitable system into a loser.
For a trader who plays both the long and short sides of the game, a regime filter allows him to adjust his trading rules to suit the prevalent market situation so as to maintain his trading edge in any market situation — in a bullish market, the system is taking only long setups, and when the market becomes bearish, he switches to shorting opportunities.
Therefore, a regime filter is very important to any trader who uses an automated system. It can help the trader avoid catastrophic losses that could occur by trading in the wrong market condition.
Understanding the use of a regime filter in trading
The importance of a trading filter cannot be overemphasized. As a matter of fact, the chances of any trading system making consistent returns over the long term depends on it trading in the right market environment — buying when the market is bullish and selling when the market is bearish. Some traders may want to stay out of the market when the conditions are unfavorable.
Therefore, to filter trading opportunities, a trader needs an efficient way of determining the current market regime. A regime filter can be a simple moving average applied to the broad market index (such as the S&P 500 Index or Russel 1000 Index) or a market breadth indicator, which can tell the trader what the general market situation is at every moment.
Many investors, who often base their market decisions on fundamental factors, use certain economic factors to predict the market regime to know whether it is right to stay invested or to move to treasuries or commodities. Some of the economic factors that define a market regime include economic growth, inflation, interest rates (cost of capital), credit expansion/contraction, and market volatility for volatility regimes.
While every market regime is a bit different, they tend to influence investor behavior in relatively predictable ways. When it comes to the equity market, history may not repeat itself; however, it rhymes in whatever is happening in the market at every point. Generally, in a deflationary economic environment, investors sell stocks and buy long-dated Treasury bonds, while in an inflationary regime, investors sell long-dated bonds and buy up equities. In a growth regime — what technical traders call a bull market — investors will bid up stocks at the expense of long-dated bonds.
Being able to classify the current market regime not only allows you to adjust your trading rules to best suit the regime but also enables you to keep our trading edge, regardless of whether the market is trending or ranging. This means that you would be buying when the overall market is rising and shorting when the overall market is falling.
A regime filter is important for every trader — whether they are trading manually or using an algo trading system. However, an algo trader needs it more than others, and here’s why: With an algo trading system, the computer places and manages trades according to the rules of the strategy it is based on. The computer trades all setups it identifies in the market, without regard to the state of the market — whether it is favorable or not.
For example, a simple momentum strategy that only buys the best-performing stocks might be making money when there is a bull market but will have a huge drawdown when the entire market is bearish. That is, buying stocks that are losing less than their peers will not produce positive returns.
In 2008, for instance, a manual trader could see that the market was in a downtrend and probably liquidate his equity positions and move to cash or Treasuries, but an automated system that had no means of identifying the bearishness of the general market and continued buying at every setup would end up with a huge drawdown by the time the bear market ended.
The indicators you can use as a regime filter
There are many indicators you can use to identify market regimes, but here, we are going to discuss only a few of them: moving average, MACD, and market breadth indicators.
The moving average indicator is perhaps the most common market regime indicator. Traders use it to know how the general market is performing so as to determine the market regime. There are different types of moving average, but most times, traders use the simple moving average (SMA) for this. It can be a 200-day SMA, as used in Sutherland Research, or a 10-month SMA.
What traders usually do is to apply the moving average to the broad market index, such as the S&P 500 or Russel 1000 index. They use the position of the index relative to its moving average to classify the market regime as either a rising market or a declining market.
If the index is trading above its 200-day or 10-month average, the market is said to be in a bullish regime, so they set their trading system to look for buying opportunities. On the other hand, if the index is trading below its 200-day or 10-month average, the market is in a bearish regime, so traders can either switch to looking for only shorting opportunities or stay out of the market entirely and probably move their capital to Treasuries or stay in cash.
With this simple regime filter, traders and investors would have avoided some of the nasty drawdowns in the market, especially the bear market of the 2008 financial crisis, and have better overall performance stats.
The moving average convergence divergence (MACD) is also another indicator traders use to check the situation of the general market to determine how to trade. The MACD is a popular momentum indicator but can also show the market trend, so it is well suited for this purpose. Traders use it just the same way they use the moving average. Being made up of two underlying moving averages, the MACD is already smoothed like the moving average indicator.
For the purpose of using the MACD as a regime filter, traders are not concerned with the Signal Line here; they’re only interested in the MACD line being above or below zero, which signals a bull or bear market condition respectively. The key is the timeframe, which determines the type of trend: long-term or medium-term trend.
Setting the indicator on the monthly timeframe shows the long-term trend. If the MACD Line is above zero, the market is said to be in a bull regime, so traders can look for buying opportunities. On the other hand, if the MACD Line is below zero, the market is believed to be in a bearish regime, so traders can either switch to looking for only shorting opportunities or stay out of the market entirely and probably move their capital to Treasuries or stay in cash.
Market breadth indicators
Market breadth indicators are used to analyze the number of stocks advancing relative to the declining ones in a given broad market or composite index. There is said to be a positive market breadth if more stocks are advancing than are declining. A positive market breath suggests that the bulls are in control of the market’s momentum, so it may be used to confirm the rise in the index. In such a situation, traders can look for buying opportunities.
On the other hand, when there is more number of declining stocks than advancing ones, the market breadth is negative. It can help confirm bearish momentum and a downside move in the stock index, warning traders to switch to short selling or stay out of the market entirely.
Here are some examples of market breadth indicators:
- Advance/decline line (A/D): This market breadth indicator plots the difference between the number of advancing and declining stocks on a daily basis. Being a cumulative indicator, positive values are added to the prior number, while negative values are subtracted from the prior number. The A/D line shows market sentiment by telling traders whether more stocks are rising or falling.
- New highs-lows index: This market breadth indicator compares stocks making 52-week highs to those making 52-week lows. An indicator reading above 50% indicates that more stocks are reaching their highs compared to stocks that are reaching their lows, which implies a rising market momentum.
Why you need to add a regime filter to your trading system
From our discussions so far, you would agree that adding a regime filter to your trading system can improve your trading in many ways. While experiences may vary among traders, here is why you need to have a regime filter in your trading system:
- It can save your account from a catastrophic drawdown: The primary reason for adding a regime filter is to prevent your system from trading during a nasty bear market. So, it reduces your chances of a catastrophic drawdown, especially if your system only looks for buying opportunities. For example, if you were trading before the 2008 bear market, you’d be happy to avoid such a bear market and protect your cash. Using a 10-month moving average as a regime filter would have kept you’re the market, or you would have switched to short selling if you had a system for that.
- It shows you the right market condition to trade: Depending on your trading strategy, a regime filter can tell you when the market is in the right condition for your trading system. For example, if you are using a buy-only momentum strategy, the right time to start buying the best performers is when there is a bullish market regime. On the other hand, if your strategy allows you to trade in either direction, you will know when to switch from buying to short selling because your regime filter will show you when a bearish market regime starts.
- It improves your profitability: By telling you when you stand a better chance of making profits from your strategy, a regime filter can help you improve profitability. The more profitable your system becomes, the more money you make.
- It helps you to minimize the chances of losing: Using a regime filter also helps you to reduce losses on a trade-by-trade basis. Here is why: you avoid trading long opportunities when the broad market is in a bearish mood. Of course, there is a higher chance of making a loss when you go long in a bearish market.
How to apply a regime filter in your trading system
So, how do you apply a regime filter to your trading system? Well, The fact is that it depends on your trading strategy and whether your trading system is automated.
Let’s assume that you are using a momentum-based strategy such that you only buy the best-performing stocks at any time you review the market. In other words, you set up your system for only long opportunities and want to be out of the market during a bearish regime. You can use a 200-day moving average as your regime filter, and your rule would be to trade only when the S&P 500 Index is firmly trading above its 200-day moving average. If you are using an automated system, you can write an overriding code that switches on your trading algo system only when the S&P 500 is above its moving average and switches off your system when a bearish market regime sets in — the S&P 500 index going below its 200-day moving average.
On the other hand, if you have a system for trading both long and short opportunities, you want to be taking the right trades in any market regime. So, if you are using a 200-day moving average as your regime filter, your rule would be to take long trades when the S&P 500 Index is trading above its 200-day moving average and to short sell when the index is trading below the 200-day moving average. To implement such a rule in an automated system — as in quanttrade — you can write an overriding code that switches to your long-trading system when the S&P 500 is above its moving average and switches to your short-selling system when the S&P 500 index is trading below its 200-day moving average.
The pros and cons of using a market regime filter in your system
There are many pros and cons to using a regime filter.
Some of the pros include the following:
- Easy to use analysis: A market regime filter provides a sort of binary analysis — bullish or bearish market disposition. So, the result can be easily applied to an already-developed trading strategy or system without modifying the strategy. Trades are carried out when certain conditions are met.
- Clear direction: Market regime filters give simple and clear directions about the disposition of the general equity market. They show you the general sentiment of the market so that you can trade in that direction if you want or stay out of the market.
- Streamlined trading: Market regime filters enable traders to streamline their trading to only one direction when the market conditions are ripe for that. A trader who employs a buy-only strategy and doesn’t want to do short selling would be able to know when to be in the market and when to stay out.
- Enormous benefits: With the help of a market regime filter, a trader can avoid situations that can lead to avoidable nasty drawdowns. An example is the 2008 financial market crisis.
Despite all the benefits, there are a few demerits, which are as follows:
- Using a regime filter may reduce capital growth: A regime filter may prevent a trader from taking some highly profitable trades that he would have taken was he not using the filter. Over time, missed trades like this may reduce the growth of capital.
- The regime filter can whipsaw during a range-bound market: Regime filters are technical indicators and can whipsaw in certain conditions. For example, the S&P 500 Index can go above and below its 200-day moving average several times in a week or month. To reduce this, it may be better to use a 10-month SMA instead of a 200-day SMA.
Tips for choosing a reliable market regime filter for your trading system
When choosing a market regime filter, make sure that it:
- Offers broad market information: That is, it is applied to a broad market index and not just any big-cap index. For example, in the U.S. stock market, it is much better to use the S&P 500 Index or Russel 1000 Index instead of the Dow 30 Index.
- Is simple to use: The regime filter should not be difficult to interpret and implement in trading.
- Can be easily coded: It should be easy to write a code for the trading rules based on the filter without tearing down the code for your already-in-use system.
- Can reliably identify the actual market regime: A reliable regime filter should not prone to frequent whipsaw movements, if not, the aim of using the filter would be defeated.
A regime filter enables traders to determine the general market sentiment to know whether or not to be in the market or move to cash in order to avoid unnecessary and avoidable drawdowns. It allows traders to adjust their trading rules to suit the prevalent market situation so as to maintain their trading edge at all times.