Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Results inconsistent with literature

Please pardon me if the answer is obvious as I don't have any formal training in com sci or finances.

Anyhoo, from what I've read, price to book ratio is a quick measure of value. Low price to book ratio stocks tend to have excess returns over benchmarks.

Great! Lets test it out. Lets buy 50 of the lowest price to book ratios and hold it for a year at a time.

The results are very encouraging. Sharpe ratio of 0.76, beats the benchmark SP500 by quite a bit. I couldn't get my sector momentum code to come even close to these results!

How about the other end? The "glamour" end, where the pb ratio is highest. Maybe if performance is much lower, we can short it. Surprise. Higher price to book ratio beats the low price to book!

How could this be? Why are they both so much better than the benchmark? Most papers that discuss this use SP500 as a benchmark and some quintiles will underperform.

Any ideas?

EDIT: I just debugged my momentum strategy code. Momentum strategy could suddenly well outperform my value portfolio. Turns out I was inadvertently leveraging. Grrrr this happens quite a bit. I wish that the API would have something to prevent this. This makes me think that there is some leveraging that is causing both ends of the pb_ratio produce returns higher than benchmark. Will report back.

15 responses

I suspect the high price-to-book results could be from the tech sector which tend to have higher ratios due to the fact they have less book value to begin with, mostly computers, servers and facilities as opposed to manufacturing companies. Maybe limit it to a specific sector and see if that changes the results.

Thanks Jeff, that's a great idea.

I tried it again, filtering out technology, but it just made the discrepancy larger. It also doesn't seem to capture all tech stocks because amazon is considered consumer cyclical.

I think you can use context.account.leverage == 0 to prevent your backtest from leveraging.

I think you can use context.account.leverage == 0 to prevent your backtest from leveraging.

context.account.leverage tells you what your current leverage is; it doesn't enforce a leverage limit. You need to do that in your code.

Disclaimer

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 Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian 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.

And here's an example of how to control leverage (it's for the contest, but can be tweaked for your use case): https://www.quantopian.com/posts/quantopian-open-example-algorithm-to-control-leverage

Disclaimer

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 Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian 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.

I feel dumb for not knowing about account.leverage. Thanks! It looks like leverage does not explain the issues I am facing.

I ran the backtest with earnings yield, and ev/ebitda. These produce the proper effect in that the "value" end outperforms the "glamour" end, however, the "glamour" end does not underperform the SP500!

This is very confusing.

The reason value "works" is that when it's wrong, you get absolutely crushed. Note that your worst drawdown is actually worse than that of the S&P 500's. Yes, value can work "over time" assuming you have enough capital and enough screens and enough discipline to actually see it through. And at the end of the day, you're lucky to break Sharpe 1. Outperforming the S&p 500 in a backtest isn't saying much.

Don't feel stupid Johnny. I am having the same problem with my fundamental-based back tests, and context.account.leverage will not fix it. Attached is the backtest for my algorithm based on ev/ebitda. The algo is designed to buy and hold 5 securities with the lowest ev/ebitda but, as you can see, it completely breaks down over time. The back-test was run for a 10 year period (May 2005 to May 2015); by the end of the back test, on May 2015, the portfolio was negative $6.8 million in cash, and held over 80 securities.

Thanks for your reply John,

Im at work so I can't troubleshoot your code but I think part of the problem is that you are rebalancing daily. Value stocks need time for its market price to catch up to its true value. Also your market cap cut off is a bit too low. Lots of value stocks are going to be small cap illiquid and loss of capital is due to slippage.

Yes, you need to add code which looks in your portfolio positions for stocks which are not part of your universe (anymore) and close them out yourself. (if that is the problem I think you are coming across).

Simon, are you referring to Johns code or mine? I think we stole code from the same template lol. There is a line that is supposed to exit all positions that are not in fundamental_df. Its under the comment exit all positions before starting new ones.

Hi John,

Here is the same code that you posted, the only exception being that it now runs re-balance every year only. This reduces slippage and commission, but also gives time for the value shares to be recognized by the market and rise again. Not shabby eh.

Here's the same algorithm, but not magically excluding three sectors, and rebalancing mid-year (and plotting that it's exceeding leverage) There's a lot of ex post alpha in these fundamental ratios, but it worries me how sensitive they are to the precise rebalancing time.

Simon, John excluded 3 sectors probably because of the book Quantitative Value by Gray and Magic Formula by Greenblatt.

EB/EBITDA works well to compare between different companies because it is capital structure neutral. It takes into account debt levels. Utilities, finances and REITs report earnings in a more complex manner so they are excluded for that reason; their ratio are not comparable to those outside of their respective sectors.

I think I may have found the answer to my original question about why my low price to book ratio sort was underperforming:

Here is an article by O'Shaughnessy
http://jimoshaughnessy.tumblr.com/post/103140701394/price-to-book-value-ratios-a-long-term-winner

Here is a summary of the article, but has a neat graph suggesting concentration of risk to a small portfolio would have caused underperformance for the periods 2006-2013
http://investorfieldguide.com/2015210the-very-cheapest-stocks-pricebook-do-very-badly/?redirect=true