No specific handling for trailing_stop_positive
This commit is contained in:
@@ -78,7 +78,7 @@ class IStrategy(ABC):
|
||||
|
||||
# trailing stoploss
|
||||
trailing_stop: bool = False
|
||||
trailing_stop_positive: float
|
||||
trailing_stop_positive: Optional[float] = None
|
||||
trailing_stop_positive_offset: float = 0.0
|
||||
trailing_only_offset_is_reached = False
|
||||
|
||||
@@ -361,8 +361,7 @@ class IStrategy(ABC):
|
||||
|
||||
# Don't update stoploss if trailing_only_offset_is_reached is true.
|
||||
if not (self.trailing_only_offset_is_reached and high_profit < sl_offset):
|
||||
# Specific handling for trailing_stop_positive
|
||||
if 'trailing_stop_positive' in self.__dict__ and high_profit > sl_offset:
|
||||
if self.trailing_stop_positive is not None and high_profit > sl_offset:
|
||||
# Ignore mypy error check in configuration that this is a float
|
||||
stop_loss_value = self.trailing_stop_positive
|
||||
logger.debug(f"{trade.pair} - Using positive stoploss: {stop_loss_value} "
|
||||
|
Reference in New Issue
Block a user