From a89c67787bf16af1a828540644a9e5b71322530b Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 18 Sep 2021 09:23:53 +0200 Subject: [PATCH] Replace some more occurances of 'buy' --- freqtrade/strategy/interface.py | 12 ++++++------ freqtrade/templates/base_strategy.py.j2 | 4 ++-- freqtrade/templates/sample_strategy.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index d3f3a1110..ce193426b 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -461,12 +461,12 @@ class IStrategy(ABC, HyperStrategyMixin): self.dp._set_cached_df(pair, self.timeframe, dataframe) else: logger.debug("Skipping TA Analysis for already analyzed candle") - dataframe['buy'] = 0 - dataframe['sell'] = 0 - dataframe['enter_short'] = 0 - dataframe['exit_short'] = 0 - dataframe['buy_tag'] = None - dataframe['short_tag'] = None + dataframe[SignalType.ENTER_LONG.value] = 0 + dataframe[SignalType.EXIT_LONG.value] = 0 + dataframe[SignalType.ENTER_SHORT.value] = 0 + dataframe[SignalType.EXIT_SHORT.value] = 0 + dataframe[SignalTagType.BUY_TAG.value] = None + dataframe[SignalTagType.SHORT_TAG.value] = None # Other Defs in strategy that want to be called every loop here # twitter_sell = self.watch_twitter_feed(dataframe, metadata) diff --git a/freqtrade/templates/base_strategy.py.j2 b/freqtrade/templates/base_strategy.py.j2 index 06d7cbc5c..3feff75c6 100644 --- a/freqtrade/templates/base_strategy.py.j2 +++ b/freqtrade/templates/base_strategy.py.j2 @@ -122,7 +122,7 @@ class {{ strategy }}(IStrategy): {{ buy_trend | indent(16) }} (dataframe['volume'] > 0) # Make sure Volume is not 0 ), - 'buy'] = 1 + 'enter_long'] = 1 return dataframe @@ -138,6 +138,6 @@ class {{ strategy }}(IStrategy): {{ sell_trend | indent(16) }} (dataframe['volume'] > 0) # Make sure Volume is not 0 ), - 'sell'] = 1 + 'exit_long'] = 1 return dataframe {{ additional_methods | indent(4) }} diff --git a/freqtrade/templates/sample_strategy.py b/freqtrade/templates/sample_strategy.py index 574819949..80fa7cdae 100644 --- a/freqtrade/templates/sample_strategy.py +++ b/freqtrade/templates/sample_strategy.py @@ -352,7 +352,7 @@ class SampleStrategy(IStrategy): (dataframe['tema'] > dataframe['tema'].shift(1)) & # Guard: tema is raising (dataframe['volume'] > 0) # Make sure Volume is not 0 ), - 'buy'] = 1 + 'enter_long'] = 1 return dataframe @@ -371,5 +371,5 @@ class SampleStrategy(IStrategy): (dataframe['tema'] < dataframe['tema'].shift(1)) & # Guard: tema is falling (dataframe['volume'] > 0) # Make sure Volume is not 0 ), - 'sell'] = 1 + 'exit_long'] = 1 return dataframe