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 Execution Price

    General Discussion
    4
    4
    1406
    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.
    • K
      KT last edited by

      I understand that if the execution type is based on market order, the price will be based on the next open price. But are there other possible ways to change the execution price? I would like to set the execution price based on stop loss or take profit price.

      Thanks :)

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

        You can tell the broker to cheat and allow with it to use the close price.

        • See Docs - Broker

        You can tell the system to cheat and allow you to intervene before the open (even if the bar is already complete)

        • See Docs - Cheat On Open

        But you cannot set the execution price to anything which is not part of the OHLC set.

        You can use bracket orders to have stop-loss/take-profit, but this doesn't guarantee an execution price.

        • See Docs - Bracket Orders
        1 Reply Last reply Reply Quote 0
        • A
          ab_trader last edited by ab_trader

          You can issue an order as stop order or limit order.
          docs - order management and execution

          • If my answer helped, hit reputation up arrow at lower right corner of the post.
          • Python Debugging With Pdb
          • New to python and bt - check this out
          1 Reply Last reply Reply Quote 0
          • K
            KT last edited by KT

            Thanks @backtrader and @ab_trader for the suggestion.

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