diff --git a/backtrader_next/brokers/bbroker.py b/backtrader_next/brokers/bbroker.py index 825cbeb79..3de6d7264 100644 --- a/backtrader_next/brokers/bbroker.py +++ b/backtrader_next/brokers/bbroker.py @@ -987,7 +987,7 @@ def _try_exec_stop(self, order, popen, phigh, plow, pcreated, pclose): # not (completely) executed and trailing stop if order.alive() and order.exectype == Order.StopTrail: - order.trailadjust(pclose) + order.trailadjust(phigh) def _try_exec_stoplimit(self, order, popen, phigh, plow, pclose, @@ -1035,7 +1035,7 @@ def _try_exec_stoplimit(self, order, # not (completely) executed and trailing stop if order.alive() and order.exectype == Order.StopTrailLimit: - order.trailadjust(pclose) + order.trailadjust(phigh) def _slip_up(self, pmax, price, doslip=True, lim=False): if not doslip: