By Jeremy Muhia

This research is published in partnership with Quantpedia, an online resource for discovering new trading ideas.

You can view the full Quantpedia series in the library along with other research and strategies.

Whitepaper author(s): Jason Wei (wei@rotman.utoronto.ca)

Whitepaper source: https://papers.ssrn.com/sol3/papers2.cfm?abstract_id=1679464

From Quantpedia:

The answer to the title question is "Yes." Examining stocks traded on the NYSE, AMEX and NASDAQ for the period of 1964 to 2009, this study discovers that, while momentum prevails among small stocks, momentum and reversals coexist among large stocks for a holding period of up to six months. The momentum/reversal divide is along the volatility dimension: Large-cap/low-volatility stocks exhibit reversals while large-cap/high-volatility stocks experience momentum. This new discovery cannot befully rationalized with either risk-based or behavioral-based explanations.

As found in the paper, stocks of large firms displayed momentum and reversals. Large firm stocks with high volatility showed momentum when taking the mean of returns for all stocks in this category. That is, large firm stocks with high volatility had high rate of acceleration in their prices. Large firm stocks with low volatility, however, showed reversals. In other words, large firm stocks with low volatility had changes in the direction of their price trends.

Performing sequential sorts on size, volatility and past returns, this study discovers that, over a holding period of up to six months, momentum and reversals coexist for large stocks. Specifically, large-cap/high-volatility stocks experience momentum while large-cap/low-volatility stocks exhibit reversals. For large-cap/low-volatility stocks, a statistically significant reversal, instead of a weaker momentum as suggested by previous findings, is observed.

At the beginning of each month, realized returns and realized (annualized) volatilities are calculated for each stock for the past one, two, three, six and 12 months. One week (seven calendar days) prior to the beginning of each month is skipped to avoid biases due to microstructure issues (see, e.g., Jegadeesh and Titman, 1993; and Chan, Jegadeesh and Lakonishok, 1996).

Similar to the methodology of the original paper, a three way sort was used to construct portfolios. First, firms were divided along the median market cap. Firms with a market cap below the median were considered "small" and firms with a market cap above the median were considered "large". The market cap quantile of each stock was stored in the `market_cap_quantiles`

column.

Next, annualized volatility with a 30 day window was calculated for each stock. These values were then grouped into 5 quantiles with the stocks at the lowest quantile receiving a value of 0 and stocks at the highest quantile receiving a value of 4. These volatility quantiles were stored in the `volatility_quantiles`

column.

Finally, past returns were calculated. Delayed past returns were also calculated with a 7 day delay in order to minimize microstructure issues as in the paper. For each lookback window used to calculated past returns, stocks were grouped into 5 quantiles based on past delayed performance. These groupings of past performance were stored in the `n day lookback - delayed`

columns.

The objective of this study was to implement this three step sorting method to create portfolios of large firms with low/high volatility and low/high returns in order to identify the reversal and momentum phenomena mentioned above.

You can navigate the rest of this notebook as follows:

Methodology and Sample

¶For the purpose of this study, portfolios are constructed using the metrics listed above. First, we measure and rank the the stocks along market cap, volatility, and delayed returns. Then, for large firms, low volatility stocks are grouped together and high volatility stocks are grouped together. Finally, within these two groups, we calculate the mean returns of the lowest performing and highest performing stocks.

This is based on the idea that the within the low volatility group, the reversal effect will cause the prices of stocks in this group to reverse, a phenomena that can be taken advantage of.

On the other had, within the high volatility group, momentum will cause the prices of high performing stocks in this group to continue to increase, another phenomena that can be taken advantage of.

In [2]:

```
data = create_data(START, END)
data.head()
# start at beginning of 09 until end of 2016
```

Out[2]:

In [3]:

```
benchmark_returns = create_benchmark_returns()
```

Below, we output the dimensions of the Dataframe in order to verify it against our approximations. Given that the Q1500 contains roughly 1500 stocks, we expect the number of rows to be roughly (1500 stocks each day x 252 days in a year x N years = number of rows).

Yet, because of constrains when doing computations with a large volume of data (in this case, a large universe of stocks evaluated over many years), we only create data once every 15 days. Also, because of events such as a stock delisting or being removed/added to the universe, the actual results may differ from our calculation.

In [4]:

```
print(data.shape)
print(len(data['SID'].unique()))
print(len(data['day'].unique()))
```

Mirroring the methodology found in the whitepaper, volatility is classified using quintiles. As expected, the mean volatility at each quintile is increasing.

In [5]:

```
fig, ax = plt.subplots()
mean_volatility = data.groupby('volatility_quantiles')['volatility'].mean()
graph = plt.bar(list(range(5)), mean_volatility, align='center')
ax.set(title='Mean Annualized Volatility by Volatility Quintile', ylabel='Mean Annualized Volatility', xlabel='Volatility Quintile')
```

Out[5]:

The visualization below digs deeper into the Pipeline's volatility. This visualization includes volatility at the median, 75th, and 25th percentiles at each volatility quintile. Outliers are also shown at each volatility quintile.

In [6]:

```
grouped = data[['volatility', 'volatility_quantiles']]
graph = grouped.boxplot(by='volatility_quantiles')
graph.set(ylabel='Annualized Volatility', xlabel='Volatility Quantiles', title='Annualized Volatility Quantiles Statistics')
plt.suptitle('')
```

Out[6]:

In the graph below, Average Dollar Volume is plotted against Volatility for each security in the pipeline. As expected, low volatility is related to higher Average Dollar Volume. Frequently traded stocks are less likely to experience significant price changes, and therefore have lower volatility.

In [17]:

```
fig, ax = plt.subplots()
x = data['volatility']
y = data['adv']
m, b = np.polyfit(x, y, 1)
plt.plot(x, y, '.')
plt.plot(x, m * x + b, '-')
ax.set(xlabel='Volatility', ylabel='Average Dollar Volume')
```

Out[17]:

In keeping with the methodology of the original study:

- Divide the universe into 2 market cap groups using the median
- Large firms have a market cap above the median
- Small firms have a market cap below the median

- Within the market cap buckets, group the stocks into 5 volatility quantiles
- Calculate the mean returns of the large firms with the lowest and highest volatility
- The lookback periods are from 2 to 90 days inclusive, [2, 90]

Using this returns data, we observe that for large firms in the lowest volatility quintile, the portfolio of high performing stocks continues to outperform the portfolio of low performing stocks only when using a short term lookback period.

However, the results of the whitepaper remain true when using a longer term lookback period. Beyond a roughly 18 day lookback period, low performing stocks begin to outpace high performing stocks at the lowest volatility quantile.

In [8]:

```
fig, ax = plt.subplots()
ax = sns.heatmap(create_spread_matrix_original(returns_data=data, returns_quantile=0, volatility_quantile=0, market_cap_decile=1), annot=True)
ax.set(
xlabel='Lookback Period (in Days)',
ylabel='Holding Period (in Days)',
title='Average Returns for Large Firms in the Lowest Returns Quintile (P1) and Lowest Volatility Quintile'
)
ax.plot()
```

Out[8]:

In [9]:

```
fig, ax = plt.subplots()
ax = sns.heatmap(create_spread_matrix_original(returns_data=data, returns_quantile=4, volatility_quantile=0, market_cap_decile=1), annot=True)
ax.set(
xlabel='Lookback Period (in Days)',
ylabel='Holding Period (in Days)',
title='Average Returns for Large Firms in the Highest Returns Quintile (P5) and Lowest Volatility Quintile'
)
ax.plot()
```

Out[9]:

Above, the matricies show the mean returns for the worst and best performing stocks of large firms with low volatility. The paper suggests that for large firms with low volatility, we should expect a price reversal.

Below, we observe at a closer level what is demonstrated in the spread matricies above. That is, as the lookback period increases with a constant hold time of 30 days, returns spreads increase. This is consistent with what is observed in the whitepaper where increasing hold times and lookback periods result in historically low performing stocks to perform better at the lowest volatility quantile.

Curiously, the returns spread shrinks with a medium term lookback periods then increases again for long term lookback periods.

In [19]:

```
plot_spreads_original(stock_data=data, market_cap_quantile=1, volatility_quantile=0, hold_time='30 day hold time')
```

This is maintained at a short term hold time as well.

So, as hold time increases, the mean returns of the lowest performing stocks continue to increase while the mean returns of the best performing stocks continue to decrease or stagnate. This aligns with the conclusion that for large firms with low volatility, a reversal affect occurs for previously high performing stocks and for previously low performing stocks.

Overall, we observe a change in the direction of the price trends. That change results in previously low performing stocks to generate higher returns than previously high performing stocks.

In [20]:

```
plot_spreads_original(stock_data=data, market_cap_quantile=1, volatility_quantile=0, hold_time='1 day hold time')
```

Now, we study the performance of this strategy at the highest volatility quintile.

Here, the results show that the portfolio of high performing stocks has greater returns than the portfolio of low performing stocks.

But, when using a short term lookback period, the portfolio of low performing stocks does continue to have greater returns than the portfolio of high perfoming stocks.

In [22]:

```
fig, ax = plt.subplots()
ax = sns.heatmap(create_spread_matrix_original(returns_data=data, returns_quantile=0, volatility_quantile=4, market_cap_decile=1), annot=True)
ax.set(
xlabel='Lookback Period (in Days)',
ylabel='Holding Period (in Days)',
title='Average Returns for Large Firms in the Lowest Returns Quintile (P1) and Highest Volatility Quintile'
)
ax.plot()
```

Out[22]: