From 9dfb3db1aa6ec3d9afb862408b9e1286b798ca7d Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 3 Apr 2022 19:22:59 +0200 Subject: [PATCH] Update local variable --- freqtrade/strategy/interface.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 7b05ce503..7b250ed9f 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -876,7 +876,7 @@ class IStrategy(ABC, HyperStrategyMixin): and self.min_roi_reached(trade=trade, current_profit=current_profit, current_time=current_time)) - sell_signal = ExitType.NONE + exit_signal = ExitType.NONE custom_reason = '' # use provided rate in backtesting, not high/low. current_rate = rate @@ -887,14 +887,14 @@ class IStrategy(ABC, HyperStrategyMixin): pass elif self.use_sell_signal and not enter: if exit_: - sell_signal = ExitType.SELL_SIGNAL + exit_signal = ExitType.SELL_SIGNAL else: trade_type = "exit_short" if trade.is_short else "sell" custom_reason = strategy_safe_wrapper(self.custom_exit, default_retval=False)( pair=trade.pair, trade=trade, current_time=current_time, current_rate=current_rate, current_profit=current_profit) if custom_reason: - sell_signal = ExitType.CUSTOM_SELL + exit_signal = ExitType.CUSTOM_SELL if isinstance(custom_reason, str): if len(custom_reason) > CUSTOM_EXIT_MAX_LENGTH: logger.warning(f'Custom {trade_type} reason returned from ' @@ -903,11 +903,11 @@ class IStrategy(ABC, HyperStrategyMixin): custom_reason = custom_reason[:CUSTOM_EXIT_MAX_LENGTH] else: custom_reason = None - if sell_signal in (ExitType.CUSTOM_SELL, ExitType.SELL_SIGNAL): + if exit_signal in (ExitType.CUSTOM_SELL, ExitType.SELL_SIGNAL): logger.debug(f"{trade.pair} - Sell signal received. " - f"exit_type=ExitType.{sell_signal.name}" + + f"exit_type=ExitType.{exit_signal.name}" + (f", custom_reason={custom_reason}" if custom_reason else "")) - return ExitCheckTuple(exit_type=sell_signal, exit_reason=custom_reason) + return ExitCheckTuple(exit_type=exit_signal, exit_reason=custom_reason) # Sequence: # Exit-signal