From 295050b80b3ebc168d84eea9cd69462a8b6977aa Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Tue, 4 Jan 2022 23:27:08 -0600 Subject: [PATCH] sell reason -> exit reason --- docs/backtesting.md | 4 ++-- freqtrade/enums/exittype.py | 2 +- freqtrade/persistence/models.py | 2 +- freqtrade/rpc/rpc.py | 2 +- freqtrade/rpc/telegram.py | 4 ++-- freqtrade/strategy/interface.py | 2 +- freqtrade/templates/subtemplates/strategy_methods_advanced.j2 | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/backtesting.md b/docs/backtesting.md index 0323d6fa9..87d870bb0 100644 --- a/docs/backtesting.md +++ b/docs/backtesting.md @@ -356,7 +356,7 @@ Hence, keep in mind that your performance is an integral mix of all different el ### Sell reasons table -The 2nd table contains a recap of sell reasons. +The 2nd table contains a recap of exit reasons. This table can tell you which area needs some additional work (e.g. all or many of the `exit_signal` trades are losses, so you should work on improving the sell signal, or consider disabling it). ### Left open trades table @@ -483,7 +483,7 @@ Since backtesting lacks some detailed information about what happens within a ca - sells are never "below the candle", so a ROI of 2% may result in a sell at 2.4% if low was at 2.4% profit - Forcesells caused by `=-1` ROI entries use low as sell value, unless N falls on the candle open (e.g. `120: -1` for 1h candles) - Stoploss sells happen exactly at stoploss price, even if low was lower, but the loss will be `2 * fees` higher than the stoploss price -- Stoploss is evaluated before ROI within one candle. So you can often see more trades with the `stoploss` sell reason comparing to the results obtained with the same strategy in the Dry Run/Live Trade modes +- Stoploss is evaluated before ROI within one candle. So you can often see more trades with the `stoploss` exit reason comparing to the results obtained with the same strategy in the Dry Run/Live Trade modes - Low happens before high for stoploss, protecting capital first - Trailing stoploss - Trailing Stoploss is only adjusted if it's below the candle's low (otherwise it would be triggered) diff --git a/freqtrade/enums/exittype.py b/freqtrade/enums/exittype.py index 2724de613..769467890 100644 --- a/freqtrade/enums/exittype.py +++ b/freqtrade/enums/exittype.py @@ -3,7 +3,7 @@ from enum import Enum class ExitType(Enum): """ - Enum to distinguish between sell reasons + Enum to distinguish between exit reasons """ ROI = "roi" STOP_LOSS = "stop_loss" diff --git a/freqtrade/persistence/models.py b/freqtrade/persistence/models.py index a1a9199fb..02a65c81e 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -1145,7 +1145,7 @@ class Trade(_DECL_BASE, LocalTrade): @staticmethod def get_exit_reason_performance(pair: Optional[str]) -> List[Dict[str, Any]]: """ - Returns List of dicts containing all Trades, based on sell reason performance + Returns List of dicts containing all Trades, based on exit reason performance Can either be average for all pairs or a specific pair provided NOTE: Not supported in Backtesting. """ diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index 3ef69e292..e099ff836 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -801,7 +801,7 @@ class RPC: def _rpc_exit_reason_performance(self, pair: Optional[str]) -> List[Dict[str, Any]]: """ - Handler for sell reason performance. + Handler for exit reason performance. Shows a performance statistic from finished trades """ return Trade.get_exit_reason_performance(pair) diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index e4eeb917f..06e82b388 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -1305,8 +1305,8 @@ class Telegram(RPCHandler): " `pending buy orders are marked with an asterisk (*)`\n" " `pending sell orders are marked with a double asterisk (**)`\n" "*/buys :* `Shows the enter_tag performance`\n" - "*/sells :* `Shows the sell reason performance`\n" - "*/mix_tags :* `Shows combined buy tag + sell reason performance`\n" + "*/sells :* `Shows the exit reason performance`\n" + "*/mix_tags :* `Shows combined buy tag + exit reason performance`\n" "*/trades [limit]:* `Lists last closed trades (limited to 10 by default)`\n" "*/profit []:* `Lists cumulative profit from all finished trades, " "over the last n days`\n" diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 7a7ebc359..b47fbf028 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -361,7 +361,7 @@ class IStrategy(ABC, HyperStrategyMixin): :param current_rate: Rate, calculated based on pricing settings in ask_strategy. :param current_profit: Current profit (as ratio), calculated based on current_rate. :param **kwargs: Ensure to keep this here so updates to this won't break your strategy. - :return: To execute exit, return a string with custom sell reason or True. Otherwise return + :return: To execute exit, return a string with custom exit reason or True. Otherwise return None or False. """ return None diff --git a/freqtrade/templates/subtemplates/strategy_methods_advanced.j2 b/freqtrade/templates/subtemplates/strategy_methods_advanced.j2 index f4002e936..820c26954 100644 --- a/freqtrade/templates/subtemplates/strategy_methods_advanced.j2 +++ b/freqtrade/templates/subtemplates/strategy_methods_advanced.j2 @@ -72,7 +72,7 @@ def custom_exit(self, pair: str, trade: 'Trade', current_time: 'datetime', curre :param current_rate: Rate, calculated based on pricing settings in ask_strategy. :param current_profit: Current profit (as ratio), calculated based on current_rate. :param **kwargs: Ensure to keep this here so updates to this won't break your strategy. - :return: To execute sell, return a string with custom sell reason or True. Otherwise return + :return: To execute sell, return a string with custom exit reason or True. Otherwise return None or False. """ return None