mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-01-28 09:50:24 +00:00
@@ -11,7 +11,7 @@ from freqtrade.constants import Config, PairWithTimeframe
|
|||||||
from freqtrade.enums.candletype import CandleType
|
from freqtrade.enums.candletype import CandleType
|
||||||
from freqtrade.exchange.exchange import timeframe_to_seconds
|
from freqtrade.exchange.exchange import timeframe_to_seconds
|
||||||
from freqtrade.exchange.exchange_types import OHLCVResponse
|
from freqtrade.exchange.exchange_types import OHLCVResponse
|
||||||
from freqtrade.util import dt_ts, format_ms_time
|
from freqtrade.util import dt_ts, format_ms_time, format_ms_time_det
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -180,15 +180,18 @@ class ExchangeWS:
|
|||||||
# Deepcopy the response - as it might be modified in the background as new messages arrive
|
# Deepcopy the response - as it might be modified in the background as new messages arrive
|
||||||
candles = deepcopy(self.ccxt_object.ohlcvs.get(pair, {}).get(timeframe))
|
candles = deepcopy(self.ccxt_object.ohlcvs.get(pair, {}).get(timeframe))
|
||||||
refresh_date = self.klines_last_refresh[(pair, timeframe, candle_type)]
|
refresh_date = self.klines_last_refresh[(pair, timeframe, candle_type)]
|
||||||
drop_hint = False
|
received_ts = candles[-1][0] if candles else 0
|
||||||
if refresh_date > candle_ts:
|
drop_hint = received_ts >= candle_ts
|
||||||
# Refreshed after candle was complete.
|
if received_ts > refresh_date:
|
||||||
# logger.info(f"{candles[-1][0]} >= {candle_date}")
|
logger.warning(
|
||||||
drop_hint = candles[-1][0] >= candle_ts
|
f"{pair}, {timeframe} - Candle date > last refresh "
|
||||||
|
f"({format_ms_time(received_ts)} > {format_ms_time_det(refresh_date)}). "
|
||||||
|
"This usually suggests a problem with time synchronization."
|
||||||
|
)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"watch result for {pair}, {timeframe} with length {len(candles)}, "
|
f"watch result for {pair}, {timeframe} with length {len(candles)}, "
|
||||||
f"{format_ms_time(candles[-1][0])}, "
|
f"r_ts={format_ms_time(received_ts)}, "
|
||||||
f"lref={format_ms_time(refresh_date)}, "
|
f"lref={format_ms_time_det(refresh_date)}, "
|
||||||
f"candle_ts={format_ms_time(candle_ts)}, {drop_hint=}"
|
f"candle_ts={format_ms_time(candle_ts)}, {drop_hint=}"
|
||||||
)
|
)
|
||||||
return pair, timeframe, candle_type, candles, drop_hint
|
return pair, timeframe, candle_type, candles, drop_hint
|
||||||
|
|||||||
Reference in New Issue
Block a user