From fa1bd269d8831965c3a28ccb8e2c7b391d68efe5 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Tue, 4 Jan 2022 23:25:41 -0600 Subject: [PATCH] sell-signal -> exit_signal --- docs/backtesting.md | 2 +- docs/bot-basics.md | 4 ++-- docs/configuration.md | 2 +- docs/hyperopt.md | 2 +- docs/strategy-callbacks.md | 2 +- docs/strategy-customization.md | 2 +- freqtrade/optimize/backtesting.py | 2 +- freqtrade/plot/plotting.py | 2 +- tests/optimize/test_backtest_detail.py | 8 ++++---- tests/test_integration.py | 2 +- tests/test_plotting.py | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/backtesting.md b/docs/backtesting.md index 1b854ba04..0323d6fa9 100644 --- a/docs/backtesting.md +++ b/docs/backtesting.md @@ -477,7 +477,7 @@ Since backtesting lacks some detailed information about what happens within a ca - Buys happen at open-price - All orders are filled at the requested price (no slippage, no unfilled orders) - Sell-signal sells happen at open-price of the consecutive candle -- Sell-signal is favored over Stoploss, because sell-signals are assumed to trigger on candle's open +- Sell-signal is favored over Stoploss, because exit-signals are assumed to trigger on candle's open - ROI - sells are compared to high - but the ROI value is used (e.g. ROI = 2%, high=5% - so the sell will be at 2%) - 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 diff --git a/docs/bot-basics.md b/docs/bot-basics.md index 1d33cbc64..9da9d4c12 100644 --- a/docs/bot-basics.md +++ b/docs/bot-basics.md @@ -35,7 +35,7 @@ By default, loop runs every few seconds (`internals.process_throttle_secs`) and * Calls `check_buy_timeout()` strategy callback for open buy orders. * Calls `check_sell_timeout()` strategy callback for open sell orders. * Verifies existing positions and eventually places sell orders. - * Considers stoploss, ROI and sell-signal, `custom_exit()` and `custom_stoploss()`. + * Considers stoploss, ROI and exit-signal, `custom_exit()` and `custom_stoploss()`. * Determine sell-price based on `ask_strategy` configuration setting or by using the `custom_exit_price()` callback. * Before a sell order is placed, `confirm_trade_exit()` strategy callback is called. * Check if trade-slots are still available (if `max_open_trades` is reached). @@ -60,7 +60,7 @@ This loop will be repeated again and again until the bot is stopped. * Call `custom_entry_price()` (if implemented in the strategy) to determine entry price (Prices are moved to be within the opening candle). * Determine stake size by calling the `custom_stake_amount()` callback. * Call `custom_stoploss()` and `custom_exit()` to find custom exit points. - * For sells based on sell-signal and custom-sell: Call `custom_exit_price()` to determine exit price (Prices are moved to be within the closing candle). + * For sells based on exit-signal and custom-sell: Call `custom_exit_price()` to determine exit price (Prices are moved to be within the closing candle). * Generate backtest report output diff --git a/docs/configuration.md b/docs/configuration.md index 995c45f2e..f0641b41a 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -333,7 +333,7 @@ If it is not set in either Strategy or Configuration, a default of 1000% `{"0": The `forcebuy_enable` configuration parameter enables the usage of forcebuy commands via Telegram and REST API. For security reasons, it's disabled by default, and freqtrade will show a warning message on startup if enabled. -For example, you can send `/forcebuy ETH/BTC` to the bot, which will result in freqtrade buying the pair and holds it until a regular sell-signal (ROI, stoploss, /forcesell) appears. +For example, you can send `/forcebuy ETH/BTC` to the bot, which will result in freqtrade buying the pair and holds it until a regular exit-signal (ROI, stoploss, /forcesell) appears. This can be dangerous with some strategies, so use with care. diff --git a/docs/hyperopt.md b/docs/hyperopt.md index b7b6cb772..47e38fa0e 100644 --- a/docs/hyperopt.md +++ b/docs/hyperopt.md @@ -206,7 +206,7 @@ Hyper-optimization will, for each epoch round, pick one trigger and possibly mul #### Sell optimization -Similar to the buy-signal above, sell-signals can also be optimized. +Similar to the buy-signal above, exit-signals can also be optimized. Place the corresponding settings into the following methods * Define the parameters at the class level hyperopt shall be optimizing, either naming them `sell_*`, or by explicitly defining `space='sell'`. diff --git a/docs/strategy-callbacks.md b/docs/strategy-callbacks.md index c72c43e20..9b2ca422c 100644 --- a/docs/strategy-callbacks.md +++ b/docs/strategy-callbacks.md @@ -9,7 +9,7 @@ Currently available callbacks: * [`bot_loop_start()`](#bot-loop-start) * [`custom_stake_amount()`](#custom-stake-size) -* [`custom_exit()`](#custom-sell-signal) +* [`custom_exit()`](#custom-exit-signal) * [`custom_stoploss()`](#custom-stoploss) * [`custom_entry_price()` and `custom_exit_price()`](#custom-order-price-rules) * [`check_buy_timeout()` and `check_sell_timeout()](#custom-order-timeout-rules) diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index cff20d5d8..497b3094d 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -235,7 +235,7 @@ def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: ### Sell signal rules Edit the method `populate_sell_trend()` into your strategy file to update your sell strategy. -Please note that the sell-signal is only used if `use_exit_signal` is set to true in the configuration. +Please note that the exit-signal is only used if `use_exit_signal` is set to true in the configuration. It's important to always return the dataframe without removing/modifying the columns `"open", "high", "low", "close", "volume"`, otherwise these fields would contain something unexpected. diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 688412044..d476efbf2 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -396,7 +396,7 @@ class Backtesting: # call the custom exit price,with default value as previous closerate current_profit = trade.calc_profit_ratio(closerate) if sell.exit_type in (ExitType.EXIT_SIGNAL, ExitType.CUSTOM_EXIT): - # Custom exit pricing only for sell-signals + # Custom exit pricing only for exit-signals closerate = strategy_safe_wrapper(self.strategy.custom_exit_price, default_retval=closerate)( pair=trade.pair, trade=trade, diff --git a/freqtrade/plot/plotting.py b/freqtrade/plot/plotting.py index 602d6f760..59184ab8d 100644 --- a/freqtrade/plot/plotting.py +++ b/freqtrade/plot/plotting.py @@ -466,7 +466,7 @@ def generate_candlestick_graph(pair: str, data: pd.DataFrame, trades: pd.DataFra ) fig.add_trace(sells, 1, 1) else: - logger.warning("No sell-signals found.") + logger.warning("No exit-signals found.") # Add Bollinger Bands fig = plot_area(fig, 1, data, 'bb_lowerband', 'bb_upperband', label="Bollinger Band") diff --git a/tests/optimize/test_backtest_detail.py b/tests/optimize/test_backtest_detail.py index 5ea54acca..32bb7ea82 100644 --- a/tests/optimize/test_backtest_detail.py +++ b/tests/optimize/test_backtest_detail.py @@ -381,7 +381,7 @@ tc23 = BTContainer(data=[ # Test 24: Sell with signal sell in candle 3 (stoploss also triggers on this candle) # Stoploss at 1%. -# Stoploss wins over Sell-signal (because sell-signal is acted on in the next candle) +# Stoploss wins over Sell-signal (because exit-signal is acted on in the next candle) tc24 = BTContainer(data=[ # D O H L C V B S [0, 5000, 5025, 4975, 4987, 6172, 1, 0], @@ -417,7 +417,7 @@ tc26 = BTContainer(data=[ [0, 5000, 5025, 4975, 4987, 6172, 1, 0], [1, 5000, 5025, 4975, 4987, 6172, 0, 0], # enter trade (signal on last candle) [2, 4987, 5012, 4986, 4986, 6172, 0, 0], - [3, 5010, 5251, 4986, 5010, 6172, 0, 1], # Triggers ROI, sell-signal + [3, 5010, 5251, 4986, 5010, 6172, 0, 1], # Triggers ROI, exit-signal [4, 5010, 5010, 4855, 4995, 6172, 0, 0], [5, 4995, 4995, 4950, 4950, 6172, 0, 0]], stop_loss=-0.10, roi={"0": 0.05}, profit_perc=0.05, use_exit_signal=True, @@ -431,8 +431,8 @@ tc27 = BTContainer(data=[ [0, 5000, 5025, 4975, 4987, 6172, 1, 0], [1, 5000, 5025, 4975, 4987, 6172, 0, 0], # enter trade (signal on last candle) [2, 4987, 5012, 4986, 4986, 6172, 0, 0], - [3, 5010, 5012, 4986, 5010, 6172, 0, 1], # sell-signal - [4, 5010, 5251, 4855, 4995, 6172, 0, 0], # Triggers ROI, sell-signal acted on + [3, 5010, 5012, 4986, 5010, 6172, 0, 1], # exit-signal + [4, 5010, 5251, 4855, 4995, 6172, 0, 0], # Triggers ROI, exit-signal acted on [5, 4995, 4995, 4950, 4950, 6172, 0, 0]], stop_loss=-0.10, roi={"0": 0.05}, profit_perc=0.002, use_exit_signal=True, trades=[BTrade(exit_reason=ExitType.EXIT_SIGNAL, open_tick=1, close_tick=4)] diff --git a/tests/test_integration.py b/tests/test_integration.py index 375fb2c12..081d80efd 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -16,7 +16,7 @@ def test_may_execute_exit_stoploss_on_exchange_multi(default_conf, ticker, fee, Sells * first trade as stoploss * 2nd trade is kept - * 3rd trade is sold via sell-signal + * 3rd trade is sold via exit-signal """ default_conf['max_open_trades'] = 3 default_conf['exchange']['name'] = 'binance' diff --git a/tests/test_plotting.py b/tests/test_plotting.py index f0a4ab388..a2377f186 100644 --- a/tests/test_plotting.py +++ b/tests/test_plotting.py @@ -223,7 +223,7 @@ def test_generate_candlestick_graph_no_signals_no_trades(default_conf, mocker, t assert trades_mock.call_count == 1 assert log_has("No buy-signals found.", caplog) - assert log_has("No sell-signals found.", caplog) + assert log_has("No exit-signals found.", caplog) def test_generate_candlestick_graph_no_trades(default_conf, mocker, testdatadir):