Hi fellow quants! 🚀
Does anyone know how I can make sure that when my options expire ITM, I'm not automatically assigned the shares of the underlying, but instead I just close the trade? I'm getting a lot of margin calls in my backtests and I want to avoid them.Â
PS: just liquidating the options 5 minutes before the closing bell during their last day of trading is not a valid answer LOL
Thanks in advance,Â
Giulio
Louis Szeto
Hi Giulio
For C#, you may implement a custom Option Exercise Model (doc). However, this functionality is not available for Python yet, as no PythonWrapper is available for this class for now. Please subscribe to this GH issue for the fixing progress.
Best
Louis
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.
Marty Scholes
I am new to Quantconnect but not coding nor automated trading. Is it possible with Quantconnect to set up a process that reverses exercises? Put another way, when a short call of mine is exercised, can an automated process immediately buy the equity and resell the same call (effectively selling a covered call), creating the illusion that the assignment never happened? Similarly, a short put assignment would immediately trigger selling the equity and reselling the same put.
As far as I can tell, this would eliminate assignment risk except for the short period of time in between assignment and resell where capital is required to carry the equity.
Is this possible?
Louis Szeto
Hi Marty
We can disable the automatic assignment by
See this, and this as examples.
Best
Louis
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.
GiulioC
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!