Back

Interactive Broker Algo Order Implementation github - help would be great

Hey all,

Spent today trying to work in Interactive Brokers Algo orders as per:

http://interactivebrokers.github.io/tws-api/ibalgos.html#gsc.tab=0

The forked github is at:

https://github.com/sic8/LeanIBAlgos/

I'm a novice coder so it took a while, but the groundwork is in. I ended up going with adding optional parameters to MarketOrder() which pass through the Algo Order Type (eg. AdaptiveAlgo), and specified algo parameters all the way through the ordering system to where they are converted and used in InteractiveBrokersBrokerage.cs to place orders through the IB API. An example of use is in BasicTemplateAlgorithm.cs.

My classes are kind of just randomly stuck in SubmitOrderRequest.cs as I don't know what the best thing to do with them is. It can be expanded later to allow limit orders etc.

There is a lot of tidying to be done sticking the classes in the right spot (where?) is just a start. If anyone with more experience than me could have a look at it and offer suggestions for improvement it would be great, looking forward to getting these features implemented on live.

Tim

Update Backtest








Oh and there are no changes to how an order type performs in backtesting using this method, An IB Algo market order is still treated as a generic market order in backtesting.

0

Cleaned and tidied up code significantly. Now supports using IB Algorithms in MarketOrders, LimitOrders and SetHoldings. Note that SetHoldings orders are forced to run synchronously, which may cause overall long execution times if using IB algorithms that take a while to complete.

Also note, none of this has been tested live/paper yet.

0

Tim Butler , I've seen that you have made a PR to QuantConnect/Lean:
Addition of Interactive Brokers Algorithmic orders
Thank you!
Next time, please create an issue on GitHub and we will guide you from there, since it is out of the scope of the community forum.

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