Strategy Library

Price Earnings Anomaly


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.

\[Price \ to \ Earnings\ Ratio=\frac{Market \ price \ per \ share}{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.


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 CoarseSelectionFunction(self, coarse):
        if self.yearly_rebalance:
            # drop stocks which have no fundamental data and have low price
            CoarseWithFundamental = [x for x in coarse if x.HasFundamentalData and x.Price > 5]
            sortedByDollarVolume = sorted(CoarseWithFundamental, key=lambda x: x.DollarVolume, reverse=False) 
            top = sortedByDollarVolume[:self._NumCoarseStocks]
            return [i.Symbol for i in top]
            return [] 

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

    def FineSelectionFunction(self, fine):
        if self.yearly_rebalance:
            fine = [x for x in fine if (x.ValuationRatios.PERatio > 0)]
            for i in fine:
                i.PERatio = float(i.ValuationRatios.PERatio)
            sortedPERatio = sorted(fine, key=lambda x: x.PERatio,reverse=True)
            self.filtered_fine = [i.Symbol for i in sortedPERatio[:self._NumStocksInPortfolio]]
            self.yearly_rebalance = False
            return self.filtered_fine
            return []

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.


div class="qc-embed-frame" style="display: inline-block; position: relative; width: 100%; min-height: 100px; min-width: 300px;">


The portfolio significantly outperforms the benchmark, S&P 500, during the two years backtest period, from the beginning of the year 2016 to the end of the year 2017.

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.


  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: