Don't fail if strategy doesn't contain sell signal
This commit is contained in:
@@ -483,8 +483,6 @@ class IStrategy(ABC, HyperStrategyMixin):
|
||||
message = "No dataframe returned (return statement missing?)."
|
||||
elif 'buy' not in dataframe:
|
||||
message = "Buy column not set."
|
||||
elif 'sell' not in dataframe:
|
||||
message = "Sell column not set."
|
||||
elif df_len != len(dataframe):
|
||||
message = message_template.format("length")
|
||||
elif df_close != dataframe["close"].iloc[-1]:
|
||||
@@ -531,7 +529,11 @@ class IStrategy(ABC, HyperStrategyMixin):
|
||||
return False, False, None
|
||||
|
||||
buy = latest[SignalType.BUY.value] == 1
|
||||
sell = latest[SignalType.SELL.value] == 1
|
||||
|
||||
sell = False
|
||||
if SignalType.SELL.value in latest:
|
||||
sell = latest[SignalType.SELL.value] == 1
|
||||
|
||||
buy_tag = latest.get(SignalTagType.BUY_TAG.value, None)
|
||||
|
||||
logger.debug('trigger: %s (pair=%s) buy=%s sell=%s',
|
||||
|
Reference in New Issue
Block a user