Hi,
I am doing a simple options strategy of selecting delta=0.5 call and put with same day expiration. When I try to do this before close, it automatically selects next day option. Is there a limitation in selecting options that are about to be expired in LEAN?
Please see the attached backtest.
Thanks
Louis Szeto
Hi Gv
Note that the sorting by expiry in line 108 is using self.Time (day0 15:00, this property has date & time), so it will be closer to day1 00:00 rather than day0 00:00. Note that the expiry of the option only has date property but not time, so it will default to be 00:00 when compare with date time object, giving you the next day as closest. While you’re allowing 0-45 days expiry options in the filtering function, I suggest you could do either of the following:
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.
Gv
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!