ibind icon indicating copy to clipboard operation
ibind copied to clipboard

live.orders filters and force = True appears broken

Open SibbiSibbi opened this issue 8 months ago • 10 comments

Hi,

If I add any filters or apply force = True to the live.orders I get an empty dictionary back. This doesn't happen when no filters or force isn't applied. Is there a way this can be fixed? This is quite important as force = True will not return a cached result, which can be a huge issue.

import logging
from ibind import IbkrClient

# Set up logging so that debug messages are visible
logging.basicConfig(level=logging.DEBUG)

def debug_live_orders():
    # Initialize the IB client (adjust port if needed)
    client = IbkrClient(port=5007)
    
    # Call live_orders with force=True to refresh orders data
    response = client.live_orders(force=True)
    
    # Output the live orders data using the debug logger
    logging.debug("Live Orders (forced): %s", response.data)

if __name__ == "__main__":
    debug_live_orders()

Many thanks!

SibbiSibbi avatar Apr 03 '25 16:04 SibbiSibbi

If I add any filters or apply force = True to the live.orders I get an empty dictionary back.

Hi, this is normal behaviour, documented here:

  • CPAPI: https://www.interactivebrokers.com/campus/ibkr-api-page/cpapi-v1/#live-orders
  • WebAPI: https://www.interactivebrokers.com/campus/ibkr-api-page/webapi-ref/#tag/Trading-Orders/paths/~1iserver~1account~1orders/get

As I understand it, after making a 1st request with force=True, you need to follow-up with force=False to obtain your data. Does this help?

salsasepp avatar Apr 04 '25 07:04 salsasepp

Hi, thanks for getting back to me. I will try that later, thanks. Do the filters work for you? I have the same issue with these, they just come back blank.

SibbiSibbi avatar Apr 04 '25 11:04 SibbiSibbi

Do the filters work for you? I have the same issue with these, they just come back blank.

I have never tried filters, can't say.

salsasepp avatar Apr 04 '25 12:04 salsasepp

I can't get the filters to work and whether the force = True is actually working I'm not sure either.. . I have problems where the system seemingly omits exiting orders

SibbiSibbi avatar Apr 07 '25 19:04 SibbiSibbi

I can't get the filters to work and whether the force = True is actually working I'm not sure either.. . I have problems where the system seemingly omits exiting orders

I remember a past issue #43 where another user seemed to experience the same, especially outside RTH. Not sure there is a solution, but there's one or two possible workarounds. Might any of that be helpful?

salsasepp avatar Apr 08 '25 06:04 salsasepp

hey @SibbiSibbi I've been seeing live orders returning an empty array too. I'd suggest addressing this with IBKR support. Also, are you executing the pre-flights as noted here: https://github.com/Voyz/ibind/wiki/Advanced-REST#-list-of-pre-flights

Voyz avatar Apr 09 '25 10:04 Voyz

Hey, thanks for getting back to me. Yes, I'm doing the preflights but I find the live.order endpoint super unreliable, it's hard to pinpoint, I think it might be caching that does not clear even though I have the force = True preflight.

SibbiSibbi avatar Apr 09 '25 15:04 SibbiSibbi

Ok, thanks for reporting back on the preflights. Yeah, I'd suggest you talk to IBKR about this

Voyz avatar Apr 09 '25 18:04 Voyz

@SibbiSibbi were you able to resolve this?

weklund avatar Apr 28 '25 14:04 weklund

I wonder if https://github.com/Voyz/ibind/issues/105 could help address this.

weklund avatar May 14 '25 22:05 weklund

I'm going to close this due to inactivity. Thanks for the contribution so far, feel free to let me know if you'd like it reopen and continue the discussion 👍

Voyz avatar Jun 23 '25 11:06 Voyz