ranaroussi / ezibpy

ezIBpy, a Pythonic Client for Interactive Brokers API
Apache License 2.0
324 stars 116 forks source link

Bracket order - Parent is GTC Profit & Stop are DAY #5

Closed rossdem699 closed 7 years ago

rossdem699 commented 7 years ago

Hey Ran,

i've been using ezIBPY and are loving how it simplifies IBPY programming. Not sure if i am missing something but when i submit a bracket order - the parent order is set for "GTC" but the child orders are submitted as "DAY" , how can i have child orders set for GTC aswell ?

ranaroussi commented 7 years ago

For some reason, I forgot to pass the tif (time in force) to the child orders in createBracketOrder. This should be fixed in version 1.12.30.

When calling createBracketOrder, setting tif="GTC" should have the original entry, as well as the target and stop child orders set for GTC.

Time in force (tif) options are:

* Taken from: https://www.interactivebrokers.com/en/software/api/apiguide/java/order.htm

rossdem699 commented 7 years ago

Cheers!!! Thanks a million again. I would have tried to fix myself but my skill level is way behind.

Sorry, i just checked it out - i am using ezibpy 1.12.31 and the child order still go in as "DAY". This could also be because i am submitting orders outside of usual trading hours?

rossdem699 commented 7 years ago

Sorry, i just checked it out - i am using ezibpy 1.12.31 and the child order still go in as "DAY". This could also be because i am submitting orders outside of usual trading hours?

ranaroussi commented 7 years ago

For some reason version 1.12.31 over-wrote the changes made in 1.12.30.

Now fixed in version 1.12.32. Upgrade using:

$ pip install ezibpy --upgrade --no-cache-dir