sell_profit_offset -> exit_profit_offset

This commit is contained in:
Matthias
2022-04-05 20:03:20 +02:00
parent bba9629a2a
commit 5ce5c70be6
13 changed files with 25 additions and 23 deletions

View File

@@ -318,3 +318,4 @@ def _validate_pricing_rules(conf: Dict[str, Any]) -> None:
def _strategy_settings(conf: Dict[str, Any]) -> None:
process_deprecated_setting(conf, None, 'sell_profit_only', None, 'exit_profit_only')
process_deprecated_setting(conf, None, 'sell_profit_offset', None, 'exit_profit_offset')

View File

@@ -151,7 +151,7 @@ CONF_SCHEMA = {
'trailing_only_offset_is_reached': {'type': 'boolean'},
'use_sell_signal': {'type': 'boolean'},
'exit_profit_only': {'type': 'boolean'},
'sell_profit_offset': {'type': 'number'},
'exit_profit_offset': {'type': 'number'},
'ignore_roi_if_buy_signal': {'type': 'boolean'},
'ignore_buying_expired_candle_after': {'type': 'number'},
'trading_mode': {'type': 'string', 'enum': TRADING_MODES},

View File

@@ -462,7 +462,7 @@ def generate_strategy_stats(pairlist: List[str],
'minimal_roi': config['minimal_roi'],
'use_sell_signal': config['use_sell_signal'],
'exit_profit_only': config['exit_profit_only'],
'sell_profit_offset': config['sell_profit_offset'],
'exit_profit_offset': config['exit_profit_offset'],
'ignore_roi_if_buy_signal': config['ignore_roi_if_buy_signal'],
**daily_stats,
**trade_stats

View File

@@ -88,7 +88,7 @@ class StrategyResolver(IResolver):
("use_sell_signal", True),
("exit_profit_only", False),
("ignore_roi_if_buy_signal", False),
("sell_profit_offset", 0.0),
("exit_profit_offset", 0.0),
("disable_dataframe_checks", False),
("ignore_buying_expired_candle_after", 0),
("position_adjustment_enable", False),
@@ -193,6 +193,7 @@ class StrategyResolver(IResolver):
# TODO: Implementing one of the following methods should show a deprecation warning
# buy_trend and sell_trend, custom_sell
warn_deprecated_setting(strategy, 'sell_profit_only', 'exit_profit_only')
warn_deprecated_setting(strategy, 'sell_profit_offset', 'exit_profit_offset')
if (
not check_override(strategy, IStrategy, 'populate_buy_trend')

View File

@@ -92,7 +92,7 @@ class IStrategy(ABC, HyperStrategyMixin):
use_sell_signal: bool
exit_profit_only: bool
sell_profit_offset: float
exit_profit_offset: float
ignore_roi_if_buy_signal: bool
# Position adjustment is disabled by default
@@ -881,7 +881,7 @@ class IStrategy(ABC, HyperStrategyMixin):
current_rate = rate
current_profit = trade.calc_profit_ratio(current_rate)
if (self.exit_profit_only and current_profit <= self.sell_profit_offset):
if (self.exit_profit_only and current_profit <= self.exit_profit_offset):
# exit_profit_only and profit doesn't reach the offset - ignore sell signal
pass
elif self.use_sell_signal and not enter: