Introduction

The Price to Earnings ratio, also known as the P/E ratio, is the ratio of a company's market price per share to the company's earnings per share.

\[P/E \ Ratio =\frac{p}{EPS}\]

where \(p\) is the stock price and \(EPS\) is the earnings per share from the most recent financial year. The P/E ratio is often used by investors to determine the valuation of a company's stock. Research suggests that a portfolio that consists of stocks with relatively low P/E ratio outperforms a portfolio that consists of stocks with relatively high P/E ratio.

Method

We pick the 10 stocks that have the lowest P/E ratio in our universe, at the beginning of each year, and we invest an equal amount of capital in each stock.

To construct the universe, first, we eliminate stocks which don't have fundamental data and stocks that have a lower price than $5 per share, using the CoarseSelectionFunction.

def coarse_selection_function(self, coarse):

    if self.time.year == self.year:
        return self.symbols

    # drop stocks which have no fundamental data or have low price
    coarse_with_fundamental = [x for x in coarse if x.has_fundamental_data and x.price > 5]
    sorted_by_dollar_volume = sorted(coarse_with_fundamental, key=lambda x: x.dollar_volume, reverse=False) 

    return [i.symbol for i in sorted_by_dollar_volume[:self.__num_coarse_stocks]]

Then, in the FineSelectionFunction, we retrieve the list of 10 stocks, that have the lowest P/E ratio.

def fine_selection_function(self, fine):

    if self.time.year == self.year:
        return self.symbols

    self.year = self.time.year

    fine = [x for x in fine if x.valuation_ratios.pe_ratio > 0]
    sorted_pe_ratio = sorted(fine, key=lambda x: x.valuation_ratios.pe_ratio)

    self.symbols = [i.symbol for i in sorted_pe_ratio[:self.__num_stocks_in_portfolio]]
    return self.symbols

In OnData(), we buy the 10 stocks that have the lowest P/E ratio in our universe. We rebalance the portfolio at the beginning of each year.

Summary

The portfolio significantly outperforms the benchmark, S&P 500, during the three and half years backtest period, from the beginning of the year 2016 to July of the year 2019.

The universe of stocks is filtered using dollar volume and price criteria. Most of the stocks chosen by the algorithm during the backtest period are small market capitalization stocks.

In theory, there is an additional factor to the small P/E ratio factor contributing to the excess returns of the portfolio relative to the benchmark. This additional factor is known as the size factor, where size in this respect, is the market capitalization of a stock.

Ranking portfolios on market capitalization and subsequently tracking their performance has demonstrated that portfolio of stocks with a small market capitalization outperforms a portfolio of stocks with large market capitalization. Another investment strategy in the strategy library, Small Market Capitalization Stock Premium, demonstrates how to form a portfolio that only consists of stocks with relatively low market capitalization.



Reference

  1. Persson E, Ståhlberg C (2006). P/E and EV/EBITDA Investment Strategies vs. the Market (Master's thesis, Linköping University, Linköping, Sweden). Online Copy
  2. Fama, Eugene F. and French, Kenneth R., Multifactor Explanations of Asset Pricing Anomalies. J. OF FINANCE, Vol. 51 No. 1, March 1996. Available at SSRN: https://ssrn.com/abstract=7365