Fix missleading variable naming

This commit is contained in:
Matthias
2022-03-16 21:31:34 +01:00
parent 20f02eb773
commit 9b2ec5e653
2 changed files with 9 additions and 7 deletions

View File

@@ -961,9 +961,9 @@ class IStrategy(ABC, HyperStrategyMixin):
else:
logger.warning("CustomStoploss function did not return valid stoploss")
sl_lower_long = (trade.stop_loss < (low or current_rate) and not trade.is_short)
sl_higher_short = (trade.stop_loss > (high or current_rate) and trade.is_short)
if self.trailing_stop and (sl_lower_long or sl_higher_short):
sl_lower_short = (trade.stop_loss < (low or current_rate) and not trade.is_short)
sl_higher_long = (trade.stop_loss > (high or current_rate) and trade.is_short)
if self.trailing_stop and (sl_lower_short or sl_higher_long):
# trailing stoploss handling
sl_offset = self.trailing_stop_positive_offset
@@ -981,12 +981,12 @@ class IStrategy(ABC, HyperStrategyMixin):
trade.adjust_stop_loss(bound or current_rate, stop_loss_value)
sl_higher_short = (trade.stop_loss >= (low or current_rate) and not trade.is_short)
sl_lower_long = ((trade.stop_loss <= (high or current_rate) and trade.is_short))
sl_higher_long = (trade.stop_loss >= (low or current_rate) and not trade.is_short)
sl_lower_short = (trade.stop_loss <= (high or current_rate) and trade.is_short)
# evaluate if the stoploss was hit if stoploss is not on exchange
# in Dry-Run, this handles stoploss logic as well, as the logic will not be different to
# regular stoploss handling.
if ((sl_higher_short or sl_lower_long) and
if ((sl_higher_long or sl_lower_short) and
(not self.order_types.get('stoploss_on_exchange') or self.config['dry_run'])):
sell_type = SellType.STOP_LOSS