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/

    What happens when I submit this bracket order?

    General Code/Help
    2
    3
    33
    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
      kav last edited by

      Consider this order:

                                  this_order  = self.sell_bracket(exectype   = backtrader.Order.Limit,
                                                                  stopexec   = None,
                                                                  price      = price, 
                                                                  data       = self.datas[0], 
                                                                  size       = size, 
                                                                  stopprice  = None,
                                                                  plimit     = round(price + .1, 2))
      

      Changing the above to set limitexec to None changes the results a lot.
      Looking at the code, it's not clear to me what does the "high side" (the one corresponding to the limitexec) order does.

      Can someone more familiar explain what sell_bracket does when limitprice is None and limitexec is bt.Order.Limit?

      1 Reply Last reply Reply Quote 0
      • K
        kav last edited by

        "Looking at the code, it's not clear to me what does the "high side" (the one corresponding to the limitexec) order does."

        meaning what does the highorder do in this one case --I understand the concept of high order in general.--

        When I do a print:

                                    print(str(this_order[0]))
                                    print(str("+++++++++++++++++++++++"))
                                    print(str(this_order[2]))
        
        -----------------------
        Ref: 755
        OrdType: 0
        OrdType: Buy
        Status: 1
        Status: Submitted
        Size: 1
        Price: 99.37
        Price Limit: 99.27
        TrailAmount: None
        TrailPercent: None
        ExecType: 2
        ExecType: Limit
        CommInfo: None
        End of Session: 737679.9999999999
        Info: AutoOrderedDict([('name', 'main')])
        Broker: None
        Alive: True
        +++++++++++++++++++++++
        Ref: 756
        OrdType: 1
        OrdType: Sell
        Status: 1
        Status: Submitted
        Size: -1
        Price: None
        Price Limit: None
        TrailAmount: None
        TrailPercent: None
        ExecType: 2
        ExecType: Limit
        CommInfo: None
        End of Session: 737679.9999999999
        Info: AutoOrderedDict([('name', 'limit')])
        Broker: None
        Alive: True
        -----------------------
        

        The first one is a buy limit with an entry price of 99.37 and a stop loss of 99.27 (?)

        but what about the second one? What does a Limit sell order with a price of None and a price Limit of None does?

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

          Typically in the orders None used for order execution type or for the price leads to the order to be executed as Market order.

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