Hello
Here is a first try to implement a variant of the PMCC option strategy.
Hope you like it :)
Have a nice day
QUANTCONNECT COMMUNITY
Hello
Here is a first try to implement a variant of the PMCC option strategy.
Hope you like it :)
Have a nice day
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.
Mia Alissi
Accessing self.portfolio instead of self.Portfolio in on_data: Security holdings are stored in self.Portfolio keyed by Symbol, not in a dict with arbitrary fields like security_type.
Looping over self.Portfolio.items() and referencing Option properties: SecurityHolding objects don’t expose underlying or ID fields, so methods such as symbol.underlying or symbol.id.option_right will not work as intended.
Checking for a long call via symbol.underlying or symbol.id.option_right is incorrect: The correct approach is to inspect each holding’s Symbol and look for Option position details.
In BuyLongCall, using atm_call.AskPrice for the option premium: OptionContract objects from the OptionChain don’t have dynamic price properties; use self.Securities[atm_call.Symbol].AskPrice.
Hardcoding the contract multiplier as 100: The correct multiplier should be obtained from self.Securities[atm_call.Symbol].SymbolProperties.ContractMultiplier.
Using self.CurrentSlice in DailyTrade: The Slice object is passed to OnData and is not stored by default on the algorithm as self.CurrentSlice, so accessing it elsewhere will fail.
Using x.right and x.expiry in DailyTrade: QuantConnect is case-sensitive about API properties; these should be x.Right and x.Expiry.
Calling self.MarketOrder(otm_targets, -2): MarketOrder should be called for each Symbol individually; you cannot pass a list of contracts.
The GetOptionGreeks method may fail if the referenced security or its HasGreekData property is missing or unsupported for some options or brokerages, potentially resulting in missing or invalid data.
Sources: Greeks and IV Implementation, Handling Data - QuantConnect.com, Index Option Call I T M Greeks Expiry Regression Algorithm, US Equity Options - QuantConnect.com, Automating the Wheel Strategy
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.
AlMoJo
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!