This post is just to share my first algorithm ever and see if anyone has any feedback.
I decided to code out Benjamin Graham's Net Current Asset Value strategy, also known as the Net Net strategy. On a chosen calendar day, the algorithm will find all companies meeting the Net Net criteria and buy an equally weighted portfolio on the next trading day. The algorithm does not include a selling component, so the portfolio will just be liquidated as the insights expire (in this case, after 1000 trading days have passed). Originally I had wanted an algorithm that buys and holds for one year and liquidates at the end of that year, but it was harder to implement than I expected. Shile Wen actually gave me an answer, but the code was a bit too advanced for me. You can find his solution here:
My goal was to backtest the period from 1 Apr 1998 to 31 Mar 2020. Since I wasn't quite able to figure out how to liquidate a portfolio at the end of a year, I decided to just do 22 one-year backtests and aggregate my results manually. I know that's a very dumb way to approach the problem, but in this case it was faster for me to do it the dumb way than to learn the smart, proper way.
Thanks to everyone who's helped me so far, especially Arthur Asenheimer and Shile Wen. I will keep at it, and one day I will be able to do this the smart, proper way.
Victor Lin
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!