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/

    Multiple Order

    General Code/Help
    3
    3
    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.
    • J
      jdrizz last edited by

      I'm new to backtrader and I've been trying to figure something out. I want to always have a set number of limit orders open.
      When an order is created, I want to add it to a list. When it is executed, I want to remove it from the list and create another order.
      It's not clear if this is something that needs to be implemented in notify_order() or in next(). From following the tutorial and some of the code examples on the site, it looks like notify_order is getting passed an Order object, but I'm not quite sure how to tell if it is executed or not.
      How would you implement this in backtrader?
      Thanks.

      R vladisld 2 Replies Last reply Reply Quote 0
      • R
        rajanprabu @jdrizz last edited by

        @jdrizz

        Please post the code what you have tried so far.. Its very hard to suggest anything without that.

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

          @jdrizz said in Multiple Order:

          I'm not quite sure how to tell if it is executed or not

          The Order class has a status property that could be used to detect the order current state:

          https://www.backtrader.com/docu/order/#order-status-values

          Take a look at the code sample in the documentation for how it about to be used inside the notify_order method:

          https://www.backtrader.com/docu/order-creation-execution/order-creation-execution/#the-full-code

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