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/

    Order 'valid' parameter not working while live trading with Interactive Brokers.

    General Code/Help
    2
    2
    49
    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.
    • Crossland Beer
      Crossland Beer last edited by

      Hi All -

      I am using Backtrader + Interactive Brokers TWS API to trade live on several futures contracts. To open positions, I am using entry stop orders and passing them with a 'valid' time.

      This setup has worked fine on my own historical backtesting as well as IBKR's historical data backtesting. However, the parameter seems to fail when working with 5s, real time bars. The orders are not cancelling when the valid time is hit.

      I have tried passing the valid variable as a datetime and timedelta. I have tried passing the time delta with minutes and seconds as the unit of time. Please let me know what I can show to make this a bit more clear. Thank you for any and all help!

      Best,
      Crossland

      B 1 Reply Last reply Reply Quote 0
      • B
        BorutF @Crossland Beer last edited by

        @crossland-beer

        What library are you using to connect to IB?

        The IBPy specified on the main backtrader website is just not working for me. Do I need Python 2 for it?

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