Hi
I am relatively new to QuantConnect, where I am in the process of developing an Iron Condor back testing strategy. Thus far, my focus has primarily been on formulating entry positions. The strategy's operational premise involves initiating an Iron Condor position 30 minutes after the market opens each day.
However, I have encountered an issue whereby the strategy only establishes positions on some days. On certain occasions, I am unable to retrieve the option chain data, causing the algorithm to abstain from taking positions. I would appreciate any insights or suggestions to address this matter.
This is where i am facing the problem. Somedays Option chain data null
# Get the Option chain
chain = self.CurrentSlice.OptionChains.get(self.symbol)
if not chain:
self.Debug(f"No Option Chain")
return
Mia Alissi
The issue you're facing seems to be related to the availability of option chain data. There might be days when the option chain data is not available for the specific symbol you're trying to trade. This could be due to various reasons such as market holidays, or the specific option contract not being traded on that day.
In your code, you're correctly checking if the option chain data is available before proceeding with the rest of the algorithm. If the option chain data is not available, the algorithm skips that day and proceeds to the next trading day.
This is the correct approach to handle such scenarios. However, if you're finding that the option chain data is not available on many trading days, you might want to consider using a different symbol or a different option strategy.
Also, in your
Initialize
method, you're setting the option filter to only include options with 0 days to expiry. This could be another reason why you're not getting any option chain data on some days. You might want to consider adjusting the filter to include options with a wider range of expiry dates.You can refer to the QuantConnect documentation for more details on how to implement an Iron Condor 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.
Sujay BABU Sekar
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!