diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index c8e930a36..5b60c0ea3 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -483,7 +483,7 @@ class FreqtradeBot(LoggingMixin): if self.config.get('use_custom_entry_price', False): buy_rate = self.exchange.get_rate(pair, refresh=True, side="buy") custom_entry_price = strategy_safe_wrapper(self.strategy.custom_entry_price, - default_retval=stake_amount)( + default_retval=stake_amount)( pair=pair, current_time=datetime.now(timezone.utc), current_rate=buy_rate) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 366ae3504..750f6f39b 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -664,10 +664,10 @@ class IStrategy(ABC, HyperStrategyMixin): """ if self.use_custom_entry_price: - entry_price_value = strategy_safe_wrapper(self.custom_entry_price, default_retval=None - )(pair=pair, - current_time=current_time, - current_rate=current_rate) + entry_price_value = strategy_safe_wrapper(self.custom_entry_price, default_retval=None)( + pair=pair, + current_time=current_time, + current_rate=current_rate) if entry_price_value is not None: if entry_price_value > low: diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index f6b8f5544..6aaa17094 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -904,7 +904,8 @@ def test_execute_buy(mocker, default_conf, fee, limit_buy_order, limit_buy_order with pytest.raises(PricingError, match="Could not determine buy price."): freqtrade.execute_buy(pair, stake_amount) -def test_execute_buy_custom_entry_price(mocker, default_conf, fee, limit_buy_order, limit_buy_order_open) -> None: + +def test_execute_buy_custom_entry_price(mocker, default_conf, fee, limit_buy_order_open) -> None: patch_RPCManager(mocker) patch_exchange(mocker) default_conf.update({'use_custom_entry_price': True})