diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index ebc129777..b85052ff9 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -511,7 +511,7 @@ class FreqtradeBot(LoggingMixin): return else: logger.debug("Max adjustment entries is set to unlimited.") - current_rate = self.exchange.get_rate(trade.pair, refresh=True, side="buy") + current_rate = self.exchange.get_rate(trade.pair, refresh=True, side=trade.enter_side) current_profit = trade.calc_profit_ratio(current_rate) min_stake_amount = self.exchange.get_min_pair_stake_amount(trade.pair, @@ -536,12 +536,7 @@ class FreqtradeBot(LoggingMixin): logger.error(f"Unable to decrease trade position / sell partially" f" for pair {trade.pair}, feature not implemented.") - def _check_depth_of_market( - self, - pair: str, - conf: Dict, - side: SignalDirection - ) -> bool: + def _check_depth_of_market(self, pair: str, conf: Dict, side: SignalDirection) -> bool: """ Checks depth of market before executing a buy """ diff --git a/tests/test_integration.py b/tests/test_integration.py index 606290495..d1fac3d71 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -311,8 +311,7 @@ def test_dca_short(default_conf_usdt, ticker_usdt, fee, mocker) -> None: # Reduce bid amount ticker_usdt_modif = ticker_usdt.return_value - ticker_usdt_modif['ask'] = ticker_usdt_modif['ask'] * 1.015 - ticker_usdt_modif['bid'] = ticker_usdt_modif['bid'] * 1.0125 + ticker_usdt_modif['ask'] = ticker_usdt_modif['ask'] * 1.004 mocker.patch('freqtrade.exchange.Exchange.fetch_ticker', return_value=ticker_usdt_modif) # additional buy order