I have been searching around and do not see much mention of multi-leg orders for options. I believe this is rather important for all strategies with short legs and allowing for proper margin calculations. Is this possible or am I missing it?
In live trading with IB, do the margins get calculated against current positions...meaning will it recogonize the short leg as a naked position or correctly as a leg? It is easy enough for backtesting, but it seems proplematic looking ahead at live trading as previous brokers I've used will only properly calculate if submitted as a single order. IB appears to support four legs directly on TWS.
Adding index options is currently listed as feature request and this ability is essential for trading index options where the requirements easily get in the millions if not properly calculated. But curious to ask all this in case my expectations are incorrect.
Alexandre Catarino
Hi DanRock
At the moment, QuantConnect/Lean only places individual orders.
Support for multi-leg orders is in our TODO list:
Combo buying power model #2709
Laurent Crouzet
"Support for multi-leg orders is in our TODO list:"
>> That would be great!
Once it is available, maybe options on futures could also be available, as they would profit a lot from it.?
DanRock
Thank you for the link. I couldn't find a specific item on github before, but I'm a bit new at this process. However, I would add that limit orders is a must have component for a multi leg strategy. It doesn't say this in the expected behavior and I'd suggest that this is probably one of the most important needs. A multi leg order gets EATEN ALIVE by slippage without being able to submit a limit at something like the midpoint of the entire strategy/order. Just to throw that out there.
Any ETA on this as its listed about a year ago now?
Thanks! And thanks for all your work to everybody working on this project. It is amazing getting to know this platform.
Alexandre Catarino
Hi DanRock
We are sorry, but we cannot give the community an ETA since it is not near the top of our TODO list that is ordered by priority.
Foren Power
Combo buying power model appears completed. Much appreciated and well done.
Is it possible to send a combo limit order to an exchange? Sorry kind of difficult to explain, meaning the brokers accepts combo limit orders for the entire combo order. That is as opposed to limit orders for each leg.
Foren Power
Correction: on tradier and as previously noted it's called multileg order. Not combo.
Alexandre Catarino
Hi Foren Power,
QuantConnect/Lean does not support combo/multi-leg orders at the moment. As you have said, we only support combo buying power. It means that when the algorithm places a new order, it will check whether it will increase or decrease the buying power in association with the previous orders.
For now, we have to keep track of OrderTick objects. I would suggest creating a tuple:
to keep a single reference for the tickets.
Jackson Dude
So if I am opening a two leg vertical trade my plan would be to submit the long leg. wait for it to be filled. minimum 1 minute wait then submit the short leg. This way I am never naked the short leg.
Code wise this is a lot of stuffing around and could result in massive slippage between submitting the two orders.
Is there a better way?
My whole point of learning QC was to back test complex option strategies. Most revolve around submitting and adjusting multi-leg strategies. The point of trading options is to limit risk, use asymmetrical risk and take advantage of Greek price model. This become painful, costly and impractical with out multi leg trades
Has the there been any progress fixing this/adding the feature?
Sorry if I am negative, QC is awesome and your work is amazing. Thank you.
Louis Szeto
Hi Jackson
We have some of the most common multi-leg strategies abstracted by the OptionStrategies class. You may also find their tutorials and examples in the Option Strategies documentation.
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.
Jackson Dude
Hi Louis,
That is awesome., Thank you. I am likely missing something.
Can you submit comb/multi-leg limit orders.
also is the ability to have multi-leg limit orders with a take profit
also is the ability to have multi-leg limit orders with a stop loss
Ideal I would like is to submit a multi-leg option trade with limit order, stop lost and take profit values.
This is what I do in think or swim. This I just submit the order get the desired fill with out to much slippage.
If the order goes bad the whole trade I would get stop out and if the whole trade goes will would take profit.
I would only have to do a market order exit if was not profitable when it got to close to expiry.
If the comb/multi-leg orders also had a limit price, target price and stop loss price parameters that would be awesome.
I could get away with a just a limit price. After the open order was filled. Submit a limit price closing order.
Currently I'm legging in and out of the spread one leg at a time. Where the first leg fill order event triggers the next second leg fill order event. Every on data event check to see if should start a trade open or closing prices one leg at a time,
I am sure you have a way to do combo/multi-leg limit orders. But can not find.
Thank you for your help and advice.
Kind Regards
Derek Melchin
Hi Jackson,
Limit orders aren't currently available with OptionStrategies. To be notified when this functionality is available, subscribe to GitHub Issue #2900.
Best,
Derek Melchin
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.
Jackson Dude
Thank you for your reply. I guess I will have to switch to strategy idea 7 until multi-leg trades are supported. Strategy 7 is a bit simpler. Single leg trading. I have found that there is too much slipping back testing multi-leg trades at market. Also using the order event filling a limit order to trigger the submitting of the next leg. Sometime the second limit order has issues. So have to wait for multi-leg limit order support. But it looks super complex. I suspect looking at it with my limited knowledge it will required a lot of complex work.
Thank you
Louis Szeto
Hi Jackson
You might consider applying the SpreadExecutionModel to control the bid-ask spread, but the filled time would be less in control. You might need to set the TimeInForce of the orders as well if that concerns you.
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.
Jackson Dude
Hi Louis,
Hope all is well with you. Though I would come back and see if the multi-log/combo option orders is possible yet with a limit order and a limit take profit and a stop limit stop lost properties. It's been a while and was crossing my fingers. I suspect this very complex and will take a lot of work.
There is no good back testing option platform with historical data. If you guy can add these features option quants from everywhere will come to your platform.
Anyway hope you have had a change to review.
I never looked at my single leg strategy idea number 8 because. The strategy had an issue with the rules when I mapped them out.
Thank you for your effort even if it is not finished yet.
Kind Regards
They J
DanRock
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!