From the documentation/samples, my understanding is that each leg of option strategies such as iron condor is not done atomically and rather each leg is executed individually. Am I correct?
Thinkorswim lets you set the price for the credit for iron condor and searches until the matching best prices is found for all legs and executes it. Is there any plan for adding a feature to let the broker handle in the quantconnect code?
If not atomic, we may run it in to issues with sharp changes in prices. Any ideas on how the current quantconnect option users are mitigating the risks?
Thanks
Mia Alissi
Yes, you are correct. In QuantConnect, each leg of an option strategy such as an iron condor is executed individually. This is demonstrated in the Iron Condor documentation, where the
OptionStrategies.IronCondor
method is called and then the order is submitted.As for your question about atomic execution and price changes, you're right that non-atomic execution can lead to issues with sharp price changes. One way to mitigate this risk is to use limit orders, which allow you to specify the maximum price you're willing to pay when buying or the minimum price you're willing to accept when selling.
As for the feature to let the broker handle the execution, there's currently no mention of such a feature in the provided extracts. However, you can always check the QuantConnect GitHub for updates and feature requests.
Lastly, to handle asynchronous orders, you can set the
asynchronous
argument toTrue
as shown in the Option Exercise Orders documentation.This allows you to send orders in batches and not wait for the response of each one, which might be useful in a large portfolio of assets.
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.
Ram Panguluri
This won't help for live trading. Back testing results also get skewed(may not be accurate) since the bid/ask spread for legs may change in different directions based on the option strategy resulting in few legs only succeed in live case.
Will look forward for redesigned Multi-leg option strategy from quantconnect team in the future releases.
Alexandre Catarino
Hi Ram Panguluri ,
Mia is not correct. If we buy an Iron Condor with her code, the legs are combined into a combo market order. We don't have an API method to achieve the results of the described Thinkorswim feature, but you can implement it in your code to find the contracts, and then create a combo order (market or limit) to execute.
Best regards,
Alex
Ram Panguluri
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!