Hi All,
Sharing my attempt to exploit the combination of two classic anomalies in factor investing, namely Small Caps and Low P/E Ratio, using the QC Algorithm Framework.
Universe: At the start of every year, find Small Cap stocks (market cap between $300M and $2B) with P/E Ratio in the 1st percentile.
Alpha: Go Long for a year.
Portfolio: Equally Weighted portfolio (investing the same amounts in each security).
Execution: Immediate Execution with Market Orders.
In the main.py script, I've included a parameter to control for rebalancing. It defaults to False but you can enter an integer to control for the number of days (calendar days) to rebalance the portfolio during the year to go back to equal weighting.
Also, in the Universe module (SmallCapsLowPERatioUniverseSelection.py script), you could modify the way I defined Market Cap and Low P/E Ratio at the end of the script.
The algo will also output some log information to check the stocks selected for the year and their P/E Ratio.
Season's Greetings!
Emilio Freire
Anthony FJ Garner
Thank you for this superb example. Truly helpful for a beginner with Lean.
Emilio Freire
Thank you Anthony FJ Garner !
Happy to help and answer questions about the algo.
Emilio
Anthony FJ Garner
Thank you so much, I will revert. I am bound to have questions.
A
Eugene
THX
Emilio Freire
Hi All,
Based on the recent implementation by the QC Team of the Market Cap filter in the FundamentalUniverseSelectionModel, I just wanted to re-share the updated version of this algo using that new feature!
Thanks to the QC Team for making this calculation easier and more accurate!
Emilio
InnoQuantivity.com
Emilio Freire
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!