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/

    Cover Order

    General Code/Help
    2
    3
    982
    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.
    • P
      Praveen Baratam last edited by Praveen Baratam

      I am aware that Backtrader supports Bracket Orders with an accompanying Stop Loss and Limit Orders.

      But what if I just want a Cover Order with an accompanying Stop Loss and with out any accompanying Limit order compared to Bracket Orders.

      As per documentation we can specify a Bracket Order manually as follows-

      mainside = self.buy(price=13.50, exectype=bt.Order.Limit, transmit=False)
      lowside  = self.sell(price=13.00, size=mainsize.size, exectype=bt.Order.Stop,
                           transmit=False, parent=mainside)
      highside = self.sell(price=14.00, size=mainsize.size, exectype=bt.Order.Limit,
                           transmit=True, parent=mainside)
      

      Now what if we just use that low side Stop type without high side Limit type order as below -

      mainside = self.buy(price=13.50, exectype=bt.Order.Limit, transmit=False)
      lowside  = self.sell(price=13.00, size=mainsize.size, exectype=bt.Order.Stop,
                           transmit=True, parent=mainside)
      

      Is it a legit scenario or will I break anything by doing this?
      Thank you.

      1 Reply Last reply Reply Quote 0
      • P
        Praveen Baratam last edited by

        hello @backtrader - Can you please throw some light on the above scenario.

        Thank you.

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

          Have you tried it?

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