Lean.Brokerages.InteractiveBrokers icon indicating copy to clipboard operation
Lean.Brokerages.InteractiveBrokers copied to clipboard

A Few More Order Types - Interactive Brokers

Open jaredbroad opened this issue 8 years ago • 12 comments
trafficstars

New order type for IB - VWAP.

jaredbroad avatar Aug 27 '17 15:08 jaredbroad

All or None // Fill or Kill Option on Orders

jaredbroad avatar Aug 27 '17 18:08 jaredbroad

Also would be nice to have Immediate or Cancel (IOC):

https://www.interactivebrokers.com/en/index.php?f=594

patrickstar1 avatar Aug 27 '17 18:08 patrickstar1

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

jaredbroad avatar Aug 28 '17 15:08 jaredbroad

Any update on these features? can we at least have all-or-none for now? Thanks!

patrickstar1 avatar Sep 06 '17 14:09 patrickstar1

Not yet sorry but we'll reply here when it is done so no need to ping thread.

Its an internal rule of QC -- bugs before features :) As long as there are red-flags we'll fix them first. If you'd like to push these features through we'd welcome a PR though!

jaredbroad avatar Sep 06 '17 14:09 jaredbroad

Bugs before Features is a very good policy. But I really need this feature because my algo goes crazy because of the partial fills - so much that I pulled the plug on it today.

I will see if I can contribute. Otherwise looks like I have to wait for you guys to pick it up.

patrickstar1 avatar Sep 06 '17 14:09 patrickstar1

Related issues/pull requests:

Ability to accept GoodTillDate and DurationValue in QC orders for IB: https://github.com/QuantConnect/Lean/issues/971 Support for GoodTillDate with Interactive Brokers: https://github.com/QuantConnect/Lean/pull/1201 Addition of Interactive Brokers Algorithmic orders: https://github.com/QuantConnect/Lean/pull/1203

StefanoRaggi avatar Apr 13 '18 08:04 StefanoRaggi

There are multiple features grouped together in this issue, so we are splitting this issue in the following tasks, to keep pull requests smaller and easier to review:

  • [x] Rename enum OrderDuration -> TimeInForce and rename Order.Duration to Order.TimeInForce

  • [x] Implement TimeInForce.Day (DAY) https://www.interactivebrokers.com/en/software/tws/usersguidebook/ordertypes/time_in_force_for_orders.htm

  • [ ] Implement Guaranteed VWAP order type https://www.interactivebrokers.com/en/index.php?f=603

  • [ ] Implement TimeInForce.GoodTilDate (GTD) https://www.interactivebrokers.com/en/index.php?f=589

  • [ ] Implement TimeInForce.FillOrKill (FOK) https://www.interactivebrokers.com/en/index.php?f=586

  • [ ] Implement TimeInForce.ImmediateOrCancel (IOC) https://www.interactivebrokers.com/en/index.php?f=594

  • [ ] Implement Order.AllOrNone (AON) https://www.interactivebrokers.com/en/index.php?f=577

  • [ ] Implement IB Algorithms with InteractiveBrokersOrderProperties https://interactivebrokers.github.io/tws-api/algos.html

StefanoRaggi avatar Apr 24 '18 15:04 StefanoRaggi

@StefanoRaggi -- a reminder that for each step we're only implementing them for backtesting and interactive brokers live, which means for all other brokerage models, we'll need to update the CanSubmit method to flag orders with these options as invalid.

mchandschuh avatar Apr 25 '18 14:04 mchandschuh

Based on many user requests, it would be nice to implement OCA - One Cancels All grouped orders. https://www.interactivebrokers.com/en/index.php?f=617 IB API is OcaGroup

linkliang avatar Jun 24 '19 21:06 linkliang

Relative Order type: https://www.interactivebrokers.com/en/general/education/videos/tws-python-api-pair-trades.php

AlexCatarino avatar Mar 25 '22 14:03 AlexCatarino