Navigation

    Backtrader Community

    • Register
    • 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/

    IBController + Backtrader, no bars being produced after connection has resumed

    General Code/Help
    ibcontroller
    5
    9
    1294
    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.
    • Z
      z_kvn last edited by z_kvn

      Hello, I recently started to use IBcontroller + backtrader in a Linux environment. I tested using E-mini SPX futures from CME whose market would close at 4:15PM EST and restart a few minutes later.

      I noticed that IBController would keep the connection alive as when I checked around 7:30 PM EST, the API connection was still showing as ok in IB Gateway and I could see it was still producing data in the Gateway UI. "ps -ef" also showed the backtrader's Python process was still there.

      However, backtrader seemed to have hung with three last bars showing same timestamp 4:15 PM EST. (I am using minute resampled quotes from ibstore data feeds). Clearly no new bars were being produced.

      I then killed the existing backtrader process and started a new one, and new bars would come in normally.

      Any idea of possible causes?

      Many thanks,

      Kevin

      1 Reply Last reply Reply Quote 0
      • N
        nooby_mcnoob last edited by nooby_mcnoob

        I've had this problem as well, the only reliable solution I've found is to restart the backtrader process and manually manage any open orders. Kinda sucks to have to do this.

        Z 1 Reply Last reply Reply Quote 0
        • bb2
          bb2 last edited by

          this problem has been discussed many times here, people including me claim that such a problem exists while the author claims against. bt's ib integration is not in ideal condition for continuous automation.

          B Z 2 Replies Last reply Reply Quote 0
          • B
            backtrader administrators @bb2 last edited by

            @bb2 said in IBController + Backtrader, no bars being produced after connection has resumed:

            while the author claims against

            This is a false statement. The author has simply stated the inability to reproduce it with his setup.

            In any case and given your persistence, please develop your own Interactive Brokers integration.

            bb2 1 Reply Last reply Reply Quote 0
            • Z
              z_kvn @nooby_mcnoob last edited by

              @nooby_mcnoob thanks for the tip. I now have experienced this same issue three days in a row. Will try the manual way and see whether it works as a workflow.

              1 Reply Last reply Reply Quote 0
              • bb2
                bb2 @backtrader last edited by

                @backtrader I am already doing so, will also share here when I am finished. Though I am really wondering what your setup is like. ibtest was not able to solve connection issues for as it is.

                1 Reply Last reply Reply Quote 0
                • Z
                  z_kvn @bb2 last edited by

                  @bb2 The issue seems to be gone in latest version.

                  https://community.backtrader.com/topic/1397/resampling-fixes-for-1-9-67-122

                  jmoons 1 Reply Last reply Reply Quote 0
                  • jmoons
                    jmoons @z_kvn last edited by jmoons

                    @z_kvn I have to say the problem is still there(my tz setting is utc+8, backtrader version: '1.9.67.122')

                    Data0, 2018-10-18T04:15:00.000000, 2816.75, 2817.75, 2815.5, 2816.75
                    Data0, 2018-10-18T04:30:00.000000, 2816.5, 2816.75, 2816.5, 2816.75
                    Data0, 2018-10-18T04:35:00.000000, 2816.75, 2817.5, 2815.5, 2815.75
                    Data0, 2018-10-18T04:40:00.000000, 2815.75, 2816.0, 2815.25, 2815.25
                    Data0, 2018-10-18T04:45:00.000000, 2815.25, 2816.25, 2815.25, 2815.75
                    ***** STORE NOTIF: <error id=-1, errorCode=1100, errorMsg=Connectivity between IB and Trader Workstation has been lost.>
                    ***** STORE NOTIF: <error id=-1, errorCode=1100, errorMsg=Connectivity between IB and Trader Workstation has been lost.>
                    
                    Z 1 Reply Last reply Reply Quote 0
                    • Z
                      z_kvn @jmoons last edited by z_kvn

                      @jmoons Thanks. I have experienced the same issue again after I added "bound off=1" to 15mins bar resampling. Not sure whether the parameter setting change is the direct cause though. Another suspicion is paper account. So far I just did testing using ib paper account and I've noticed the paper account server has different maintenance schedule from ib production server.

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