Is there a way in QC to execute a credit spread or debit spread as a single order ? The margin / buying power requirements for legging in are stupidly high. If so, where do I find information? I want to go “live” within the next 30 days and want to use spreads initially instead of long calls or puts.
Bill Crocker
I assume you are BUYing one and SELLing the other.
Does it help if you submit the BUY order first,
Derek Melchin
Hi Michael,
It's not currently possible. LEAN submits one order for each contract in the spread. We have GitHub Issue #5693 to make position sizing easier. At the moment, if we place the orders separably, Lean should be able to combine them implicitly to reduce the buying power model.
Best,
Derek Melchin
Want to invest in QuantConnect as we build the Linux of quant finance? Checkout our Wefunder campaign to join the revolution.
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.
Michael Dehring
Hello Derek,
Thank you for your reply! Though that kind of stinks since the margin requirements through any sequential order placement on a credit spread is terrible (worse if short then long, long than short still worse then combined). Long leg first, then short leg (or visa versa) has numerous problems especially since there is no guarantee that a leg will fill or you can get the spread pricing you are relying on in your model. Worse is it drives up transaction costs and risk. Are there plans to fix this? It seems like something natively supported by brokerages who allow options trading. I think IB API has native support for single spread execution orders.
Bill Crocker
If one or more brokers support it then Lean should support it. You should have to state your intent to use it in the Initialize section. If the connected broker does not support it, then you error-out right at the start. I have been using this interactively with ThinkOrSwim for years. Transact all or nothing. Kind of state-or-the-art. (Hope the TD Ameritrade brokerage support dream comes true.)
Louis Szeto
Hi Michael and Bill
They cannot be used as a single order, but LEAN still supports multi-leg orders with automatic margin adjustment in backtest. Some of them are abstracted in the OptionStrategies class to handle the asynchronous filling issue. In live mode, your broker will take care about the margin. You may refer to this page for some examples.
Best
Louis
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.
Michael Dehring
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!