Can you beat SPY with SPY? And I'm not talking about these two guys.
Image src: https://spy-vs-spy.fandom.com/wiki/Spy_vs_Spy
Markets tend to rise gradually but fall sharply. The strategy capitalizes on this asymmetry. By temporarily exiting the market when it dips below a certain threshold, we aim to avoid the steepest declines.
With less than 30 lines of code this strategy performs better than buy and hold considering both result and draw down.
Enjoy!
Disclaimer:This information is for educational purposes only and is not intended as financial advice. It's important to conduct your own thorough research and analysis before making any investment decisions. Investing involves risk, and past performance is not indicative of future results.
Mia Alissi
Sources: Momentum Effect In Commodities Futures, Gaussian Naive Bayes Model, Leveraged ETFs With Systematic Risk Management, Turn Of The Month In Equity Indexes, Upcoming Holiday Momentum for Amazon
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.
Ezra Citron
Is this not just a trailing stop loss on SPY?
Henrik Strand
Hi Ezra Citron ,
Yes, with the addition of the "time out of market".
I was not able to get a callback for when the in built trailing stop loss kicked in so this is another solution for it.
But basically, the main idea is to show that with a few lines of code one can beat buy and hold.
Henrik Strand
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!