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?



  • 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?



  • "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?



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


Log in to reply
 

});