Hello everyone, I have been looking at https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/option-strategies/call-calendar-spread and noticed some strange behaviour in this implementation. A calendar call is when we sell near-term and buy far-term keeping the same strike. Getting 100% ATM is almost impossible so we get slight ITM or OTM instead. Now, if I use weeklies, and if I change X in the snippet ( return universe.IncludeWeeklys().Strikes(-1, 1).Expiration(timedelta(4),timedelta(X)) ) to 30,50,90: it gives me the same contracts regardless (AAPL 220506C00157500 & AAPL 220520C00157500).
My understanding of the Expiration method in this context is we define with it , - near and far terms. The incorrect contract pick is caused by
calls = [i for i in chain if i.Strike == atm_strike and i.Right == OptionRight.Call]
taking a strike from the chain and then excluding all contracts that do not have this strike limiting our choice. It would be good to have some data validation because we may have a case (i.e. we happen to hit a strike of 145.25 when the rest of the chain is spaced 0,50) where for very liquid equities we may have a narrow trading spread.
any thoughts on this? unless I am mad and missing something …
Louis Szeto
Hi AlexP
Thank you for bring up this. The strategy doc page is served as technical reference purpose. We encourage users to implement based on their own logics. But you’re absolutely right! We must check for the spread size!
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.
AlexP
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!