From 5fe18be4b57163971329905afb9e8833f77ed154 Mon Sep 17 00:00:00 2001 From: kevinjulian Date: Fri, 23 Jul 2021 01:25:15 +0700 Subject: [PATCH] add note buy_tag and split 3 assignment for get_signal --- docs/strategy-advanced.md | 4 ++++ freqtrade/strategy/interface.py | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/strategy-advanced.md b/docs/strategy-advanced.md index 62b1533a6..fb78a8796 100644 --- a/docs/strategy-advanced.md +++ b/docs/strategy-advanced.md @@ -140,6 +140,10 @@ def custom_sell(self, pair: str, trade: Trade, current_time: datetime, current_r ``` +!!! Note + `buy_tag` is limited to 100 characters, remaining data will be truncated. + + ## Custom stoploss The stoploss price can only ever move upwards - if the stoploss value returned from `custom_stoploss` would result in a lower stoploss price than was previously set, it will be ignored. The traditional `stoploss` value serves as an absolute lower level and will be instated as the initial stoploss. diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index a6329aaa1..35c162c38 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -530,9 +530,10 @@ class IStrategy(ABC, HyperStrategyMixin): ) return False, False, None - (buy, sell, buy_tag) = latest[SignalType.BUY.value] == 1,\ - latest[SignalType.SELL.value] == 1,\ - latest.get(SignalTagType.BUY_TAG.value, None) + buy = latest[SignalType.BUY.value] == 1 + 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', latest['date'], pair, str(buy), str(sell)) timeframe_seconds = timeframe_to_seconds(timeframe)