flake 8 fixes

This commit is contained in:
axel 2021-08-03 16:25:18 -04:00
parent 53fb8b05e7
commit 00939b63f2
3 changed files with 7 additions and 6 deletions

View File

@ -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)

View File

@ -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:

View File

@ -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})