How does one address the issue of regime shift in algorithmic trading? by Laurent Bernut
Fascinating topic that has kept me awake for years. It is a thorny issue. As the patent clerk Einstein used to say: answer are not at the same level as questions. Answer is not at the signal (entry/exit) level. These are position sizing and order management issues.
Definition of regime change
Everybody has a savant definition, so i might as well come up with a simple practical metaphor. imagine You drive at 150 km/h on the highway and then all of sudden, this 4 lanes turns into a country road. If You do not react quick, you will go tree-hugging.
There are three market types: bull, bear and more importantly sideways. Each type can be subdivided into quiet or choppy. So, we have six sextants. Regime change is when market moves from one box to another.
It can be either a new volatility regime, or a move from bear to sideways, sideways to bull or vice versa. Markets rarely move from bull to bear. There is some battle between good and evil.
Why it matters?
Many strategies are designed to do well in a particular environment. They make a lot of money that they end up giving back when regime changes. Examples:
- Short Gamma OTM: sell OTM options and collect premium. Pick pennies in front of a steam roller. 2008–2009, August 2015, CHF depeg, Brexit etc. 1 day those options will go in the money and game over
- Dual momentum: trade the shorter time frame but determine regime on longer time frame. When market hits a sideways period, market participants get clobbered on false breakouts like poor cute little baby seals
- Mean reversion: works wonders in sideways markets until it does not. An extreme version of that is Short Gamma
- Value to growth and vice versa: that is probably the most lagging one. By the time, my value colleagues had thrown the towel and loaded up on growthy stocks, market usually gave signs of fatigue…
- Fundamentals pairs trading: relationships are stable until market rotation. For instance, speculative stocks rally hard in the early stage of a bull market, while quality trails. Example: Oct-Dec 2012, Mazda went up +400% while Toyota rallied +30%
The vast majority of market participants are trend followers, whether it is news flow, earning momentum, technical analysis. Trending bulls they do great, trending bears, they can survive. Sideways is where they lose their shirts on false positives.
The issue often boils down to how to enter a sideways regime without losing your shirt
The value of backtests
I agree that backtests will help you identify when your strategy does not work. This is actually the real value of backtest. This is when you modify the strategy and adapt the position sizing to weather unsavoury regimes. Then trade this version, not the ideal fair weather strategy.
Reason is simple: everybody’s got a plan until they get punched in the teeth. So don’t lower your guard, ever.
Asset allocation across multi-strats
Some market participants like to develop specific strategies for specific markets: sideways volatile, awesome for pairs trading, great for options strangle/straddle short. Breakouts are good for trending markets etc.
How do You switch from one to the next ? Fixed asset allocation is as clunky, as primitive and as MPT as it gets. There is something far more elegant and simple:
- Calculate trading edge for each sub-strategy: long Trend Following, pairs etc
- pro-rate trading edge for each strategy
- Allocate by pro-rata
- Allocate a residual minimum even to the negative trading edge strategies
This is a simple way to put money where it works best
Regime change for single strategy
When not to trade
Van Tharp believes that there is no strategy that can do well or at least to weather all market conditions. I believe there is more nuance. Is the objective to make money across all market regimes? For example, sideways quiet are preludes to explosive movements. In order to make any money, you need to trade big and if you are on the wrong side when things kick off, game over
We trade a single unified (mean reversion within trend following) strategy. What follows is our journey through solving the regime change issue. We found that the three best ways to manage regime changes are
- Stop Loss:
- position sizing:
- order management:
Regime changes are usually accompanied with rise in volatility. Volatility is not risk, volatility is uncertainty #de-friendSharpeRatio
We used to have a complex stop loss rule. Now we have a uniform elegant stop loss. It just lags current position. It is fashionably late, hence its name: French Stop Loss.
The idea there is to give enough breathing room to the markets to absorb changes without giving back too much profit.
Our solution is to consider stop loss as a fail safe and allow the market to switch direction bull to bear and vice versa within the confine of a stop loss.
The result is we end up switching from one regime to the next more fluidly. We have reduced the number of stop losses by 2/3, which in turn has materially increased our expectancy.
Stop losses are costly. They are the maximum you can lose out of any position.So, unless you have a kick ass win rate or extremely long right tail, you want to reduce their frequency and allow the market to transition.
The first thing You need to understand is that You cannot predict/anticipate a regime forecast. You will find out after the facts. This has some immediate consequences on position sizing: always cap your portfolio risk
Many position sizing algorithms use equity in layers or staircase. We base our calculation of peak equity. So, drawdowns however small have an immediate impact on position sizing. This slams the break much faster than any other method i know.
The other side of the equation is risk per trade wich oscillates between min and max risk. When regime becomes favourable again, it accelerates rapidly.
The whole premise is early response to change in regime through position sizing
Another feature is trend maturity. Betting the same -1% at the beginning and at the end of a trend is asking for a serious kick in the money maker. Trends are born, grow, mature, get old and eventually die one day, just like believers in Efficient Market Theory. So, risk less as you pyramid.
Order management and hibernation
Along with the position sizing comes a vastly underrated feature in most order management: trade rejection.
Secondly, we use a position size threshold. When markets get too volatile and we experience some drawdown, stop losses dilate. As a result, position sizes get smaller. When sizes are too small, trades get rejected.
Order management is vastly under-utilised in most systems i have seen. It is often binary, all-in/all-out, or one way scale in or scale out.
In our system, taking profit off the table is a not a function of chart, technical analysis but driven by risk management. Until price goes a certain distance, exits are not triggered. If exits are not triggered, entries cannot be triggered either. Since volatility goes up and position sizes get smaller, the system drops into hibernation.
We have factual evidence that hibernation during an unfavourable regime is a powerful mechanism to weather regime change. It involves a lot more sophistication than muting indicators, slope flattening etc. It encompasses position sizing, order management, stop loss and to a lesser degree signals.
trat asset allocation based on pro-rated trading edge is the easy way to go.
Single strat across multiple market regimes means acceleration/deceleration but also hibernation. This is not an easy problem. There is one thought that kept me going through the frustration of figuring this out: “Building a system is like watch making. Time will always be off until the final cog fits in”