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/

    bracket_order expiration date question?

    General Discussion
    2
    3
    606
    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.
    • Y
      yeahaa828 last edited by

      Is it possible to set a bracket_order that will expire only if the parent order was not executed within the expiration date? If the parent order was executed within the expiration date then the expire date will be ignored.

      From my experiments that valid expiration date will cancel the order regardless.

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

        No. It's a different order. Its activation is linked to the execution of the parent, but the details are independent.

        1 Reply Last reply Reply Quote 0
        • Y
          yeahaa828 last edited by

          Ok thanks, to solve this I am now storing all of my order instances in a dictionary and, monitoring every next() increment. I check the date through order.created and if it hasnt entered a trade by a certain timeframe I cancel it and if it does I leave it open.

          Do you think using order.created is a good approach?

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