I copied some CS code from LEAN repo, with insignificant changes.
The idea is to trade diagonal call spreads. Profit by keeping the premium from selling the short leg, and also profit when the long leg goes up in value.
Problems:
- The algo gets a margin call and doesn't recover gracefully
- The algo buys the underlying.
- Backtest chart shows the exact opposite of what you'd expect, rising at 6/1/19 and 3/20/20, probably the result of the margin calls. GOOG underlying goes up dramatically in that time so diagonal call spreads would have done quite nicely except at the above mentioned dates.
Any ideas for how to fix any of the issues above? Once fixed it should be a very lucrative looking play.
Kevin Baker
Running it with AAPL instead of GOOG avoids the margin call, and nets a profit. There is an interesting spike which might be due to Assignment. Reminds me of the Robinhood user who was so very seriously alarmed by assignment, and seeing huge dollar figures in his transactions.
So the only help needed now is to get it to roll the contracts into temporary bear spreads during downturns to make margin call way less likely. That way bigger positions can be played.
Kevin Baker
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!