Fix notify_enter attempting to fetch rate during testing.

This commit is contained in:
Reigo Reinmets 2022-01-10 20:30:32 +02:00
parent 30d293bfec
commit 26f2db4777

View File

@ -16,7 +16,7 @@ from freqtrade.configuration import validate_config_consistency
from freqtrade.data.converter import order_book_to_dataframe
from freqtrade.data.dataprovider import DataProvider
from freqtrade.edge import Edge
from freqtrade.enums import RPCMessageType, SellType, State
from freqtrade.enums import RPCMessageType, SellType, State, RunMode
from freqtrade.exceptions import (DependencyException, ExchangeError, InsufficientFundsError,
InvalidOrderException, PricingError)
from freqtrade.exchange import timeframe_to_minutes, timeframe_to_seconds
@ -695,7 +695,9 @@ class FreqtradeBot(LoggingMixin):
if open_rate is None:
open_rate = trade.open_rate
current_rate = self.exchange.get_rate(trade.pair, refresh=False, side="buy")
current_rate = trade.open_rate_requested
if self.dataprovider.runmode in (RunMode.DRY_RUN, RunMode.LIVE):
current_rate = self.exchange.get_rate(trade.pair, refresh=False, side="buy")
msg = {
'trade_id': trade.id,