Hi,
I am running in some troubles regarding options in the research pane. I want to plot a chart with the midprices of 1 minute bars of SPY calls that are ATM on the first day of the timeframe. However, in my accompanying notebook, the selection of ATM options doesn't seem to work. the filters method requires a minimum of 1 up and down, which includes more strike prices than only the ATM one. How can you select just 1 contract? furthermore, the filter returns more contracts than just the one expiring within the 40 day timeframe. How can I circumvent this?
Help is much appreciated, thanks :)
Jack Simonson
Hi Igor,
It's possible to filter the results above for the ATM option, but you can also create single Options using the Symbol.CreateOption() method. Another way to do this is to use the OptionChainProvider to retrieve a list of all options contracts for the symbol on a given day, and then select the one you want to get historical data for. I've attached a notebook that shows both of these methods.
Igor Quint
edit: ups, accepting the answer leaves me unable to personally thank you ;)
Thanks a lot Jack! this is exactly what I needed. These examples give me a lot more to work with. Thanks again.Â
Â
Igor Quint
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!