Switched close_reason back to sell_reason

This commit is contained in:
Sam Germain
2021-06-20 02:53:59 -06:00
parent 73dbc7a2f4
commit e198d7f3d2
17 changed files with 79 additions and 79 deletions

View File

@@ -32,11 +32,11 @@ class SellCheckTuple(object):
NamedTuple for Sell type + reason
"""
sell_type: SellType
close_reason: str = ''
sell_reason: str = ''
def __init__(self, sell_type: SellType, close_reason: str = ''):
def __init__(self, sell_type: SellType, sell_reason: str = ''):
self.sell_type = sell_type
self.close_reason = close_reason or sell_type.value
self.sell_reason = sell_reason or sell_type.value
@property
def sell_flag(self):
@@ -225,7 +225,7 @@ class IStrategy(ABC, HyperStrategyMixin):
return True
def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,
rate: float, time_in_force: str, close_reason: str,
rate: float, time_in_force: str, sell_reason: str,
current_time: datetime, **kwargs) -> bool:
"""
Called right before placing a regular sell order.
@@ -242,7 +242,7 @@ class IStrategy(ABC, HyperStrategyMixin):
:param amount: Amount in quote currency.
:param rate: Rate that's going to be used when using limit orders
:param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).
:param close_reason: Sell reason.
:param sell_reason: Sell reason.
Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',
'sell_signal', 'force_sell', 'emergency_sell']
:param current_time: datetime object, containing the current datetime
@@ -592,7 +592,7 @@ class IStrategy(ABC, HyperStrategyMixin):
logger.debug(f"{trade.pair} - Sell signal received. "
f"sell_type=SellType.{sell_signal.name}" +
(f", custom_reason={custom_reason}" if custom_reason else ""))
return SellCheckTuple(sell_type=sell_signal, close_reason=custom_reason)
return SellCheckTuple(sell_type=sell_signal, sell_reason=custom_reason)
if stoplossflag.sell_flag: