Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
PE Ratio Strategy - Happy to get some feedback and practical tips

Dear All,

I wrote an algo based on P/E, ROE and Profit Margin. The results look good. But I am just wondering am I missing anything? Will be happy to receive some practical advice and tips to make future models more realistic.

The logic of the algo is fairly simple. First of all, typically companies with high PEs are companies that have high momentum in their stock prices. For instance, in 2018, at its peak, Amazon had a PE ratio of around 150x. But I realise that if the earnings are low, the PE ratio can be distorted. As such, I put in additional filters like ROE > 8% and Profit Margin > 8 % to control for the effects of weak earnings distorting the PE.

7 responses

I started reading "The Little Book That Still Beats the Market" a few days ago and interestingly the simple strategy mentioned above coincides with the "Magic Formula" mentioned in the book.

Hello JOHN SOH ,

I was testing this algo for a longer time frame. This seems to have a diff result for a bull market & bear market.
I read the same book. What I think it was lagging was this exact same issue.

Hey aritra bhattacharjee,

Thanks for the reply. The strategy does not look the same to me. My backtesting started in 2014 so if it's the same strategy as yours, then from 2014 onwards, the losses should narrow and at least convert. It's puzzling why during the crisis it fell so much more than the market. It's worth examining.

Hello JOHN SOH,

I have modified some parameters & ran a backtest from 2003 to 2019. Result looks good.
Basically I have added RSI parameter for getting the risk factor. Also I am assigning some percentage for low or high availability of cash.

Issue I see is the leverage & required cash. IMO in some cases this can go out of hand. Current leverage is max 2.5x & max cash negative is 4x of initial value.

So are you only buying or selling on the first day of each month ?

Hello craig sling,

Yes, this is to mainly avoid trading fee. Also I would have to decrease the % of allocation for a trade if done weekly or daily to keep leverage on check. But as of now I am doing a great job on that.

What if you rebalanced weekly but swapped out of longs that fall in your ranking list for the new ones that may come in higher at that time?