Highest high since position was opened | Backtrader Community

PHOTO EMBED

Fri Jun 11 2021 21:59:51 GMT+0000 (UTC)

Saved by @abrocod

def notify_trade(self, trade):
    if trade.justopened:
        self.position_bar = trade.baropen
        self.position_highest = float('-inf')
content_copyCOPY

https://community.backtrader.com/topic/850/highest-high-since-position-was-opened/