diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index d17b442ab..482ac598f 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -659,7 +659,7 @@ class Exchange: candle_limit = self.ohlcv_candle_limit( timeframe, self._config['candle_type_def'], - int(date_minus_candles(timeframe, startup_candles).timestamp() * 1000) + dt_ts(date_minus_candles(timeframe, startup_candles)) if timeframe else None) # Require one more candle - to account for the still open candle. candle_count = startup_candles + 1 @@ -2043,7 +2043,7 @@ class Exchange: timeframe, candle_type, since_ms) move_to = one_call * self.required_candle_call_count now = timeframe_to_next_date(timeframe) - since_ms = int((now - timedelta(seconds=move_to // 1000)).timestamp() * 1000) + since_ms = dt_ts(now - timedelta(seconds=move_to // 1000)) if since_ms: return self._async_get_historic_ohlcv( @@ -2503,7 +2503,7 @@ class Exchange: ) if type(since) is datetime: - since = int(since.timestamp()) * 1000 # * 1000 for ms + since = dt_ts(since) try: funding_history = self._api.fetch_funding_history( @@ -2833,7 +2833,7 @@ class Exchange: if not close_date: close_date = datetime.now(timezone.utc) - since_ms = int(timeframe_to_prev_date(timeframe, open_date).timestamp()) * 1000 + since_ms = dt_ts(timeframe_to_prev_date(timeframe, open_date)) mark_comb: PairWithTimeframe = (pair, timeframe, mark_price_type) funding_comb: PairWithTimeframe = (pair, timeframe_ff, CandleType.FUNDING_RATE)