Back

IB Combo Orders

Hi,

IB supports combo orders thu their Java API:

https://www.interactivebrokers.com/en/software/api/apiguide/java/placing_a_combination_order.htm

Is it possible to access/place combo orders in LEAN?  Or to access the IB API and place them directly when events happen in my QC algos?

Thanks,

j

Update Backtest








At the moment, we cannot place a combo (AKA multi leg) order with LEAN, but it is a ticket in our TODO list.
It is not possible to access the IB API through the QC API.

0

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.


I noticed a reference to combo legs in InteractiveBrokersClient.cs on github.  If there's anything I can help with in implementing this let me know.  IB's API is open source on github and their combo functionality is fairly well documented, so it shouldn't be too bad to extend LEAN.

Sorry, couple of other questions...

* looking through InteractiveBrokersClient.cs it looks possible to get market depth information (updateMarketDepth, etc) from IB but I haven't been able to find a good example of this in the documentation.  I'm pairs trading stocks and want to be able to put in buy & sell limit orders that are highly likely to be filled.  So it would be great to check market depth direct from IB right before sending the orders (I'm working at second resolution).

*  can you give me a sense of the latency difference (both for market info and order placement) between coding the algo's directly in IB's API vs through LEAN?

Thanks.  Great platform btw!

0

We would be very happy if you could implement combo orders in Lean.
Please checkout the Contributor's Guide.
Also, take a look at IBrokerage and IBrokerageFactory implementations.
You can open an github issue where you can ask for help and make questions.

About your other questions:
* We do not have documentation on market depth, because, despite the fact we can get it from IB, we still need to implement it in our API to make it available. This is a feature that we may have in the future.

* LEAN adds negligible latency (order of 1ms). However LEAN is not designed for HFT and if that is a concern we wouldn't recommend using it.

0

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.


Update Backtest





0

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.


Loading...

This discussion is closed