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/

    check if an order would be accepted before its created

    General Code/Help
    2
    3
    72
    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.
    • Bayne
      Bayne last edited by Bayne

      Hey Coders and Backtrader supporters,

      Is there an inbuilt function to check if an order would be accepted (without sending it?)

      Otherwise, if i want to build such an order, (only for backtesting purposes), what should it check else but the margin? (+ any tips how to get the current margin)

      Motivation:
      I need to send Takeprofit and stoploss at the same time as the main ordercreation to get reliable backtesting results

      (e.g. if the order is completed and the TP & SL are beeing sent but the current HighPrice hits the level where the unexecuted TP will be (which gets executed at the next bar)

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

        You have to manually check it, just like in real life. But your approach doesn't have the goal to achieve reliable backtesting results. Quite the opposite.

        Bayne 1 Reply Last reply Reply Quote 0
        • Bayne
          Bayne @backtrader last edited by

          @backtrader yes and what else but the margin do i need to check in this case?

          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(); }); }