I introduced the notion of momersion in a recent article. In this article I present an indicator of momersion along with simple code for Amibroker.
The Momersion indicator measures momentum and mean-reversion over a specified lookback period n. It is an oscillator (0 – 100) that is calculated as follows:
Momersion(n) = 100 × MOMc/(MOMc+MRc) (1)
where MOMc is a count of momentum and MRc is a count of mean-reversion, calculated as follows (pseudocode):
For lookback period n
MOMc = 0
MRc = 0
For i = 1 to n do
If r(i) × r(i-1) > 0 then inc(MOMc)
If r(i) × r(i-1) < 0 then Inc(MRc)
Momersion(n) = 100 × MOMc/(MOMc+MRc)
where r(k) is the kth arithmetic return.
Below is code for Amibroker. Copy and paste the code in a new formula.
Below is a chart of Momersion(250) for S&P 500 index from 01/1989 to 08/11/2015.
When the Momersion(n) indicator is below the 50% line, price action is dominated by mean-reversion and when it is above it, it is dominated by momentum. It is clear that other than a recent surge for a short period after 2011, with the help of a lot of quantitative easing, momentum died around the peak of the tech bubble market. A few remarks:
- There can be trends in mean reverting mode, as in the 2000s
- Trend-following works also with trends that occur in mean-reverting mode
- When mean-reversion dominates, the probability of extreme events is high
- After 2011 the market is in a state of “momersion”
The most challenging markets to trade are those that are in a state of momersion, i.e., they dynamically change from momentum to mean reversion constantly.
Article updated September 19, 2020, with Amibroker code for subscribers and a new chart.
Charting and backtesting program: Amibroker