Mean Reversion: Identify and forecast stocks before they move

  • By Paul Wilcox
  • October, 14
Blog Mean Reversion: Identify and forecast stocks before they move

Erez Katz, Lucena Research CEO and Co-founder

In spite of the world markets slow down, the US market continues to exhibit extraordinary returns. When the great majority of stocks move higher in tandem, some hedge funds look at lagging individual securities that have yet to follow the trend, in anticipation that they too will eventually “join the party” and catch up. These constituents, with sound fundamentals, if timed correctly could yield short term outperformance.

 

Why is identifying mean reversion beneficial? 

Temporary down pressure can come in many forms, such as a large fund liquidating its positions, or a rogue analyst downgrading the company. Those who have perfected the process of identifying stocks with an impending trend reversal are destined to benefit greatly and well ahead of the major indexes. 

A typical machine learning classifier would start from a clean slate where an objective function is defined (outperform the S&P, for example). The classifier would gradually move from feature selection into hyper parameter tuning and model training.

For this example, we have gone about it a bit differently by forming a hypothesis and constructing a straw man model to support it. Specifically, we’ve defined two features to support a mean reversion pattern which we will first validate and subsequently use a machine learning classifier to improve it.

 

The game plan to discover ideal constituents 

  1. First, validate if healthy companies that lagged their peers eventually caught up.
  2. Next, fine tune our predetermined feature set in order to increase accuracy while maximizing benchmark outperformance (alpha). 
  3.  

The mean reversion model

I will be using Lucena’s flagship platform, QuantDesk which can run the scenarios outlined above with ease and with virtually no coding required.

As you can see below, we’ve created a model composed of four technical and fundamental factors. All of the underlying factors are “ranked factors” which indicates that rather than capturing their absolute values, we capture their value relative to their normalized peers’ average.

 

technical and fundamental factors for mean reversion

 

The first factor — slow stochastic bounded rank — is a technical factor geared to identify stocks that underperformed their benchmark (i.e., a stock that lagged the S&P 500).

The subsequent three factors are fundamental measures of the underlying companies’ financial health. In short, we are looking to identify stocks that temporarily underperform but are otherwise perfectly healthy.

The QuantDesk Event Study is perfectly suited to identify the constituents that meet the model criteria over a predetermined time in the past (2010-2012, in our case). As you can see, the Event Analyzer outlines how on average the stocks performed prior and subsequent to the day in which they were identified (“event date”). 

The results are summarized below as follows:

 

Lucena Research Event Analyzer

 

Where is the machine learning?

The challenge is that with so many factors derived from multiple data providers, how can one construct the optimal, most predictive scan?

That’s where Lucena’s machine learning classifier comes in handy. The Event Study enables the construction of such a multi-factor scan by inspecting the stocks that outperformed in a known period in the past (training data). After the scan is complete, the Event Analyzer assesses the most common attributes between all the winning stocks.

Once we’ve ascertained that the scan has been predictive through training in the past (in sample), we can further test the efficacy of such a scan. Using a new unseen period (out of sample) we can mobilize the scan for a perpetual intraday assessment by which it flags stocks primed for a mean reversion move. 

 

Validating our hypothesis of mean reversion driving outperformance

Now that we have a promising model that can classify optimal entry of positions with an impending upwards trend reversal, we can test our model over time using the QuantDesk Backtester.

Below you can see how the backtest simulates a portfolio (in orange) that evaluates constituents before the market opens daily. When constituents match the criteria, the portfolio simulates a buy at the open and a hold for 21 days. Notice how the backtest dates are completely out of sample (1/1/2013 to present) — remember our training timeframe was 1/1/2010 to 12/31/2012.

 

Backtesting for mean reversion

Furthermore, QuantDesk allows a perpetual forward trading simulation of the same rules of the backtest on a “live” paper trading portfolio.

The constituents that matched the scan criteria on Friday 10/11/2019 are listed below:

 

Constituents for mean reversion

 

On Monday’s open 10/14/2019, the portfolio will simulate a buy of the above constituents.

 

Forecasting stock prices

Stock picking is a tricky business and not suitable for all investors. The ability to validate a  hypothesis via out-of-sample backtesting and using a paper traded portfolio should increase our odds of success when we’re ready to deploy real capital. 

QuantDesk is a powerful platform which holds all the capabilities to implement hypotheses, validate them historically through backtesting and perpetually through paper trade simulation

Those who are patient and can endure some short term volatility could benefit greatly by implementing a systematic approach to mean reversal signals.

 

Test your own hypothesis with a QuantDesk free trial. Have questions? Drop them below or contact us

Have a media inquiry or a topic you’d like to contribute to our blog?