@gleetche
@gleetche said in Bracker Order Questions:
if self.p.switchp1p2:
p1, p2 = p2, p1
valid1, valid2 = valid2, valid1
Ignore this for now, the docs tend to try to provide all possibilties when entering at the terminal using args.parse.
Here is simple example of a bracket order.
order = self.buy_bracket(
size=size,
exectype=bt.Order.Market,
stopprice=stop_price,
stopexec=bt.Order.Stop,
limitprice=limit_price,
limitexec=bt.Order.Limit,
)
Order will be a list containing the three orders like:
[entry_order, stop_order, limit_order]
@gleetche said in Bracker Order Questions:
What is transmit in the bracket argument?
Transmit gets used when you are entering the orders separately, not like my example above. Setting transmit=False
tells backtrader not to execute the first order by itself. Wait until all the orders are arranged, and then enter them (transmit) them together, so that the first order can be connected to later orders.