I've looked through the forums and there seems to be some different answers on the efficiency of using the options.SetFilter and the self.OptionChainProvider. I am trying to just make an IC that looks at the closest expiration to 45 days and short leg is at .16 Delta. The SetFilter backtest is taking forever and I wasn't sure if the OptionChainProvider will be able to use Greeks to sort through the option contracts. Also if someone has found a way to have this just run on a hourly basis or just not every minute, that would help a lot. Attached is the backtest for reference.
Derek Melchin
Hi Erik,
Greek values are only available after an option contract has been added to the algorithm. Therefore, we can't currently use the OptionChainProvider to select an option based on greek values. We have an open GitHub Issue to enable option universe selection based on Greek values. Subscribe to our progress here.
To run the algorithm above on an hourly basis instead of every minute, we can add the following condition to OnData:
if slice.Time.minute == 0: return
See the attached backtest for reference.
Best,
Derek Melchin
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.
Erik schuh
Thank you. That helps some! The problem is I still see my profit2 is logged every minute (Line 59). How is that happening if the TradeOptions shouldn't be running every minute and just every hour?
Also it seems the Implied Volatility is always 0. Not sure why the options pricing model is not working.
Derek Melchin
Hi Erik,
To run TradeOptions once every hour, the code above should actually read
if slice.Time.minute != 0: return
To get non-zero implied volatility values, we need to add the option price model.
option.PriceModel = OptionPriceModels.CrankNicolsonFD()
See the attached backtest for reference.
Best,
Derek Melchin
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.
Erik schuh
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!