I am noticing in my backtest that options that are expired remain in Portfolio and are 'Invested'. I assumed that they would automatically be removed or at least show a 0 quantity as expirations and assignments seem to occur automatically. Is it something that I am missing or an error in the engine or is it expected to ignore expired securities and I must liquidate myself?
Ari Cooperman
I figured out why this is happening. Looks like on the market closing slice for the option on day of expiration, and OptionExercise order type is being sent. However, I had a call to close all open orders before that exercise is filled and it gets canceled.
I am not sure what is the proper behavior here:
Â
Derek Melchin
Hi Ari,
I was unable to reproduce this error. Please attach a backtest which demonstrates the issue so we can further assist.
Best,
Derek Melchin
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.
Ari Cooperman
Here is an example test that shows it happens.Â
Â
Â
Ari Cooperman
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!