Hello, I am new to Quantconnect, mainly interested in options trading, trying to asses whether its suits my needs.
In an attempt to run a basic options strategy I got the massage that options splits are not currently supported. So I am trying now to liquidate my portfolio on the close before the split, how can I know that a split is about to occur between the close of the current bar and the open of the next one?
One more question regarding options - if I want to buy an option, I did not see any strategy that does that, so what I did is to define the strategy as Naked Call/Put and Sell the strategy. There must be a simpler way, I guess?
Thanks, Nathan
Mia Alissi
Hello Nathan,
To detect a split event, you can use the
OnData
method in your algorithm. This method receives aSlice
object that containsSplits
data. You can check if a split is about to occur for a specific symbol by checking if that symbol is in theSplits
dictionary. Here is an example:This way, you can detect a split and liquidate your portfolio accordingly.
Regarding your question about buying options, you can use the
Buy
method to buy an option. Here is an example:In this example,
option_symbol
is the symbol of the option you want to buy andquantity
is the number of contracts you want to buy.Please note that the
OptionStrategies.NakedCall
andOptionStrategies.NakedPut
are used to define option strategies, not to buy or sell options directly. When you sell a naked call or put, you are selling an option that you do not own, which is different from buying an option.I hope this helps! Let me know if you have any other questions.
Sources:
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.
Nathan Sela
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!