Key features:
- Market cap between 80 million and 1 billion.
- Assigns scores to stocks based on fundamental ratios: TotalYield, EearningsYield, TotalAssetsGrowth, EVtoEBIT, BookValueYield.
- Additionally assigns scores based on market cap - smaller caps receive higher score.
- At the beginning of each year it will weigh stocks based on above criterias and purchase 35 top stocks and hold them for a year, then repeat the process.
This strategy is primarily based on Valuation and Operational ratios from Morningstar database. It will assign weights for each of the valuation ratio parameters as well as market cap.
Generally smaller companies outperform larger companies, here, instead of hard capping universe to only small caps I found it's better leave a hard cap on 1 billion dollars, but base the final score on the market cap as well. This way it has lower chance to miss higher market cap bargains with exceptional fundamentals.
Even based purely on market cap score you can already outperform S&P500, what makes this strategy outperform so much is filter only the “cheapest” stocks based on the following factors: larger total yield (dividend + buyback), larger earnings yield,, lower EV to EBIT ratio, higher book value yield.
Additionally I observed that stocks show mean reversion in their earnings growth and total assets year-to-year growth. So I added TotalAssetGrowth score to prefer lower total assets growth for the last year. This will somewhat prevent buying cyclical companies on top of their cycle.
I decided to use holding of 1 year to optimize on taxes (long term tax vs short term) as well as fees.
There are multiple papers I used to base my decisions on, let me know in the comments I can link them and explain further the logic behind some of the choices.
Kristofferson V Tandoc
Hi Denis Litvin,
Have you had the chance to try this in live paper trading?
Kris
David E
Thank you for posting this. I paid for one of those online courses called “The Cash Flow Academy”. I actually thought they did a pretty good job. Taught the basics of fundamental analysis, Warren Buffet style value investing, mostly in dividend stocks and focused on accumulation of assets rather than trading. They then sold covered calls on the assets to try and cash flow on the assets along with collecting dividends. I've tried a ton of intraday strategies and cant find a single profitable approach (Frustrated - Wasted a lot of time and some money) I'd like to try to develop a method to run “the cash flow” type strategy on here and this is a great first start. I'll have to go back and look at my notes on what I was using for fundamental screeners. Do you know if these backtests correctly account for dividends?
One thing I noticed with your algo is that the year hold isn't quite a year. I ran a backtest from 2020, 1, 1 to current and it bought on 01/03/2020 and sold on 12/19/2020. It did the same thing with orders on 01/01/2022 and sold on 12/22/2022. For that 10-15% of tax savings it would be worth making sure it holds the stocks for a full year before selling.
Denis Litvin
Hi Kristofferson V Tandoc,
Short answer - no. And I likely won't, however it's mostly because of the nature of this strategy, which is very low frequency. So what I do is I use it as a sort of filter or screener. I then dive deeper into every company that pop up, when the holding period is that long I think it's worth to spend some extra time.
In terms of how well this performance stack up to live trading, all I can say it's working, and it's been working for at least past 100 years, and not only in USA market (though it's been much higher in USA).
Denis Litvin
Hi David Eldringhoff,
Agree with you, I will post more cash flow and value investing oriented strategies.
Backtest doesn't account for dividends, so it could produce couple extra % return a year.
Good catch it's not quite a year in a backtest. I was having difficulties to set it up in a way that it would hold for a year + 1 day for tax saving purposes yet make it buy from new universe of stocks right after. Let me know if you figure out how to adjust the algo to account for that. Right now the algo resets the universe at the first trading day of the year and holds for 245 trading days. If I simply increase holding period, it will end up using leverage for some time during January as it wouldn't sell the stocks from previous year yet, which will produce higher return but it's not realistic. So I took a shortcut here to make it more accurate. The backtest also doesn't account for taxes, that's going to greatly affect profitability.
Denis Litvin
Fixed the holding period to be year + 1 day
Jeroen van Hoof
Hi, nice work.
Looking at your first code, it seems like the algorithm has an enormous increase mainly between 2000 and 2014. From 2014 to 2020 it seems to be going much less steep. If you run it from 2000 till now, it gives a 15000% net profit. But running it from 2014 till now gives only 130% net profit. Have you investigated what could be the reason for this?
One thing I was also wondering, why are you subtracting the assets growth from the value score?
Denis Litvin
Hi Jeroen van Hoof ,
I've noticed value factor was underperforming growth factor for the past 10 years, this is not the only model that exhibits this behavior.
The reason I am subtracting the assets growth from the value score is to prevent buying cyclicals at the top of the cycle, I should note that it's not the most reliable way and I am still searching for better features.
Michael0000
Awesome, great stuff!
How would i go about making an inverse list of all that was captures by the long list, and shorting all these stocks that come up?
How would i go about adding something like within 5% of 52Low and go long (also, within 5% of 52High and go short)?
thanks!!
Denis Litvin
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!