Hi!
I have been using the OptionChainProvider.GetOptionContractList method for pulling a list of contracts for index options. This function would return a list of all available option contracts for any given underlying and time
e.g.
self.OptionChainProvider.GetOptionContractList(canonical_symbol,TIME)
would return a list of all possible contracts with the underlying associated with the canonical_symbol and TIME.
However, since a recent update, this method only works ~20% of the time, and the other times it actually returns an empty list! It should never be returning an empty list in my case (as I am looking at SPX weekly contracts) because there is always a non-zero amount of index option contracts on SPX weekly contracts. So there is some sort of issue that appeared only within the past 2 weeks or so that has broken this method.
Is there a workaround for retrieving a list of all available option contracts for a given underlying and time WITHOUT subscribing to the options beforehand? This method was perfect, but now it is clearly broken and needs a substitute.
Attached is a backtest demonstrating the issue! Once cloned, run the algorithm, and in the logs you will see that a majority of days don't work, however, occasionally the method does what it is supposed to.
Mia Alissi
Sources: Greeks and IV Implementation, Option Expiration Week Effect, Basic Template Index Daily Algorithm, Option Indicators Regression Algorithm, Debugging - QuantConnect.com
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.
Leo Kamgar
The mia alissi answer simply returned the same code that I had already provided. I am wondering if there is a workaround for the functionality of self.OptionChainProvider.GetOptionContractList()?, or if the original functionality of this method could be fixed?
Leo Kamgar
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!