I have to share how frustrated I am with the API. It seems like options trading isn't well thought out. I've spent so much time debugging obscure error messages and trying to find example code than on the results of the backtests. As much time as I've spent on it, I don't feel like I understand it any better. It's the opposite, the more time I've spent with, the more confusing and undocumented intermediate to advanced parts are. Your only hope is maybe a discussion post maybe talking about it.
At first, I thought the issue was Python, so I switched to C#. That helped a little with the various runtime errors.
Why is it so difficult to manage the legs of an options strategy? For example, closing one side of an IronCondor should be a single API call. Maybe these should even be built into the OptionStrategy object itself.
I often ask myself, why isn't this built-in? Why do I have to write a get-by-delta method? Why do I have to write a find-by-strike price method? There is so much repeated code in the examples that someone should realize there's a need to have this be common code in the API.
Some of these problems could be improved with better documentation. There are common option actions like rolling where there could be better documentation or, better yet, should be built into the API. There is documentation for HelloWorld-level strategies but nothing for even intermediate-level strategies. Where is the example of an IronCondor with basic stop loss and profit taking?
Then you get to weird object differences such as OptionLeg and Option.Leg. I can understand the need for two different objects, but are there no API helper functions to convert between them? If OptionStrategy stores as OptionLeg but ComboLegLimitOrder requires Option.Leg, why isn't there a good way to convert them?
Mia Alissi
I understand your frustration, Jesse. It seems like you're encountering some challenges with the options trading API and the lack of certain built-in functions. I agree that having more built-in functions for common tasks would be beneficial and could potentially reduce the amount of repeated code.
In terms of managing the legs of an options strategy, it appears that the recommended approach is to use the Combo Leg Limit Order. This was mentioned in a forum discussion by Louis Szeto, who suggested sticking with Combo Leg Limit Order for limit orders. He also mentioned that using Combo Orders will automatically calculate the multi-leg margin, which might help with managing the legs of an options strategy.
As for the lack of built-in methods for getting options by delta or finding options by strike price, I can see how these would be useful. Unfortunately, I don't have any information on whether these will be added to the API in the future.
Regarding the documentation, it seems like there's a need for more advanced examples and tutorials. I found a forum discussion where Alexandre Catarino mentioned that the team was working on more examples that will be presented as tutorials. However, I don't have any information on whether these will include examples of an IronCondor with basic stop loss and profit taking.
Lastly, I understand your confusion about the difference between OptionLeg and Option.Leg. Unfortunately, I don't have any information on whether there are any API helper functions to convert between them.
I hope this helps a bit, and I encourage you to continue sharing your feedback and suggestions. It's through feedback like yours that improvements can be made.
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.
Jesse Tyson Anderson
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!