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/

    Broker to execute the order with the closing price and not with the average price

    General Discussion
    2
    4
    67
    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.
    • Afonso Schulz Albrecht
      Afonso Schulz Albrecht last edited by

      Current situation: the order is issued in the "next" method and then before the start of the next candle, the method "notify_order" will check if there's an order request pending and execute them at the average price.

      What I expect: I would like that the order is executed with the closing price of the candle that I use to issue the order.

      is it possible to do it with backtrader?

      1 Reply Last reply Reply Quote 0
      • A
        ab_trader last edited by

        Search cheat-on-close in the forum and documentation.

        1 Reply Last reply Reply Quote 0
        • Afonso Schulz Albrecht
          Afonso Schulz Albrecht last edited by

          I've already tried it, however this will take the open price of the next candle. And I want to take the closing price of the current candle (the one of when I released the order). The behaviour expected is: release the order and make the broker action the order right away.

          1 Reply Last reply Reply Quote 0
          • A
            ab_trader last edited by

            cheat-on-close forces bt to execute orders on the close of the current bar. Order notifications come on the next bar.

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