Introduction
Book-to-market ratio is used to find the value of a company by comparing the book value of a firm to its market value. The definition of the book-to-market ratio is
\[\begin{equation} \begin{aligned} BTMR &= \frac{CSE}{Market \ cap} \\ &= \frac{Book \ value \ per \ share}{Share \ price} \end{aligned} \end{equation}\]
where \(CSE\) is the common shareholders equity. Book value represents a company's assets minus its liabilities and sometimes is referred to as shareholders' equity. Price-to-Book Ratio is defined as
\[PTBR = \frac{Share \ price}{Book \ value \ per \ share}\]
Therefore, we can see the Book-to-market ratio is the inverse of the P/B ratio. The book-to-market ratio suggests how much investors are paying against each dollar of book value in the balance sheet. The bigger the ratio is, the more fundamentally cheap is the investigated company. This algorithm will create the portfolio with this factor.
Method
To construct the universe, first we eliminate stocks which don't have fundmental data. In the FineSelectionFunction,
we calculate the market cap with PE ratio, earning per shares, and shares outstanding and assign the property MarketCap
to each fine fundamental object. The universe is narrowed to top 20% companies with the highest market cap.
According to the algorithm, the portfolio is weighted based on market cap. We calculate the weight in the FineSelectionFunction
and save
them in self.weights
.
fine = [x for x in fine if (x.valuation_ratios.p_b_ratio > 0)]
top_market_cap = sorted(fine, key = lambda x:x.market_cap, reverse=True)[:int(len(fine)*0.2)]
top_bm = sorted(top_market_cap, key = lambda x: 1 / x.valuation_ratios.p_b_ratio, reverse=True)[:int(len(top_market_cap)*0.2)]
self.sorted_by_bm = [i.symbol for i in top_bm]
total_market_cap = np.sum([i.market_cap for i in top_bm])
self.weights = {}
for i in top_bm:
self.weights[str(i.symbol)] = i.market_cap/total_market_cap
return self.sorted_by_bm
In the next step, we sort the stocks with the inverse of P/B ratio by descending order. Quintile portfolios are then formed based on the Book-to-Market ratio and the highest quintile is held for one year.
Summary
The portfolio underperforms relatively to the benchmark, S&P 500, during the backtest period.
In general, stocks that have a low B/P ratio are considered to be value stocks, and similarly, stocks that have a high B/P ratio are referred to as growth stocks.
During a bull market, which is associated with high GDP growth, value stocks tend to underperform growth stocks, as investors are optimistic about future earnings growth.
Derek Melchin
See the attached backtest for an updated version of the algorithm with the following changes:
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Jing Wu
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!