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/

    How can I cancel all orders?

    General Code/Help
    3
    4
    441
    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.
    • O
      Ololo last edited by

      how to cancel all open orders at the moment?

      run-out 1 Reply Last reply Reply Quote 0
      • O
        Ololo last edited by

        @backtrader @ab_trader

        1 Reply Last reply Reply Quote 0
        • run-out
          run-out @Ololo last edited by

          @ololo said in How can I cancel all orders?:

          how to cancel all open orders at the moment?

          At the beginning of next:

          [self.cancel[o] for o in self.broker.orders if o.status < 4]
          

          All status below 4 are live.

          RunBacktest.com

          R 1 Reply Last reply Reply Quote 2
          • R
            rodket @run-out last edited by

            @run-out said in How can I cancel all orders?:

            [self.cancel[o] for o in self.broker.orders if o.status < 4]

            Thanks bro, it helps a lot with a little change:
            [self.cancel(o) for o in self.broker.orders if o.status < 4]

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