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/

    Backtrader doesn't receives data from TWS after a few hours of running

    General Code/Help
    2
    5
    41
    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.
    • amir mansoubi
      amir mansoubi last edited by

      Hi everyone!

      I have some problems in passing the right params to Cerebro, store, and feed.

      I need to trade US futures (for example 30 of them) with my custom strategy, live at IB.
      TRADES and sometimes BID_ASK data are used.
      Also, I need next() to be called every minute regardless of data is received completely or not, As I have some big problems making TWS work properly.
      Adding to this, backfilling at the start is desirable.

      My resampledata() input params are like this now:

      • rtbar=True

      • historical=False

      • backfill_start=True

      • backfill=True

      Now it works for a few hours continuously and then suddenly it stops, while TWS is running and datas are CONNECTED and also the script is running but next() is not called.

      So what should I change? Is there any major change needed?

      1 Reply Last reply Reply Quote 0
      • vladisld
        vladisld last edited by

        @amir-mansoubi said in Backtrader doesn't receives data from TWS after a few hours of running:

        I need next() to be called every minute regardless of data is received completely or not,

        Not sure it works this way, AFAIK in live scenario the next() is called on each new bar produced by any feed added to cerebro engine ( and not by schedule)

        @amir-mansoubi said in Backtrader doesn't receives data from TWS after a few hours of running:

        Now it works for a few hours continuously and then suddenly it stops

        Could you please take a look at the TWS API log and see if some unexpected warnings or bust events (since you are using real time bars ) are present.

        1 Reply Last reply Reply Quote 0
        • amir mansoubi
          amir mansoubi last edited by

          @vladisld thanks for answering.

          Actually, I use IB GATEWAY which doesn't have any API log. But there is a Gateway log for the day.
          Is it useful?

          1 Reply Last reply Reply Quote 0
          • vladisld
            vladisld last edited by

            @amir-mansoubi said in Backtrader doesn't receives data from TWS after a few hours of running:

            I use IB GATEWAY which doesn't have any API log

            The Gateway do have the API logs - there is an option to view it right from the UI or download each daily log separately.

            1 Reply Last reply Reply Quote 0
            • amir mansoubi
              amir mansoubi last edited by

              @vladisld
              Unfortunately, it was unchecked in settings.
              I enabled it and will send the log next time thr problem happens.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
              $(document).ready(function () { app.coldLoad(); }); }