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/

    IB feeds question

    General Discussion
    2
    3
    240
    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.
    • C
      chewbacca last edited by

      Hey guys, so, I've backtested the strategy and I'm now ready to try running on IB demo paper account.
      The strategy needs 2 datafeeds - one "live" minutely (the current day from market open), and one daily (with history going back 3 years, so it has to have the historical=True).

      How to add new daily data to the "3 year history" feed after each day ends (market close), so the last day's OHLCV would always be available on the next day's open (along with the history data)? Does backfill work on a feed created with historical=True ?

      What are the possible options for this? Does BT have to be restarted before each market open, or are there other options (i.e. running BT continuously) ?

      Regards

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

        @chewbacca said in IB feeds question:

        Does BT have to be restarted before each market open, or are there other options (i.e. running BT continuously) ?

        Also BT could be run continuously, both TWS and TWS Gateway need to be restarted daily (https://financefeeds.com/interactive-brokers-adds-auto-restart-feature-tws-platform/) even with auto-restart feature enabled. It means all the data subscriptions need to be renewed anyway.

        IMHO it is easier ( and cheaper if you run in cloud) to start/shutdown the system on (extended) trading session start/end every day. If in cloud - it even could be easily done using scheduling APIs.

        1 Reply Last reply Reply Quote 0
        • C
          chewbacca last edited by

          @vladisld said in IB feeds question:

          @chewbacca said in IB feeds question:

          Does BT have to be restarted before each market open, or are there other options (i.e. running BT continuously) ?

          Also BT could be run continuously, both TWS and TWS Gateway need to be restarted daily (https://financefeeds.com/interactive-brokers-adds-auto-restart-feature-tws-platform/) even with auto-restart feature enabled. It means all the data subscriptions need to be renewed anyway.

          IMHO it is easier ( and cheaper if you run in cloud) to start/shutdown the system on (extended) trading session start/end every day. If in cloud - it even could be easily done using scheduling APIs.

          It's not in the cloud, it's in a local VM, and I know that restarting the bot is easier, however, I was looking for a solution that would allow me to run the bot continuously.

          Actually I've found a very nice function that will probably work - backwards() @ linebuffer.py
          Placed it @ log_data called in each next()/notify_timer() with the current day's date, so if a bar enters data1 - it should remove it.
          So, now waiting for live data to see what'd happen :)

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