Backtrader Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    existing order info from ibbroker

    General Code/Help
    2
    2
    440
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dongiulio last edited by

      Hello,

      Because TWS sometimes disconnects and sometimes requires re-login, I need to include an occasional restart of my trading system and TWS dockers.

      Because my TS is based on limit orders (and not market orders) when I restart there might be orders still pending from a previous session, I would need to extract from interactive brokers the info about the existing pending orders, so that I can manipulate them (i.e. cancel them)

      I'm struggling to get this info, I've explored:

      self.broker.orders which don't seem to be available for an IBBroker,
      self.broker.ib which has lots of info, but don't seem to see anything order related

      how could I get this info?

      Thanks,
      Giulio

      1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators last edited by

        The existing broker doesn't implement that functionality.

        Store the orders when notified in your own non-volatile (database, file, ...) and retrieve them as needed.

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors