Skip to content

Commit 62e3f40

Browse files
committed
chore: make some internal fetch-trades methods require since
1 parent 9b0beb0 commit 62e3f40

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

freqtrade/data/history/history_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def _download_trades_history(
444444
if not trades.empty and since < trades.iloc[-1]["timestamp"]:
445445
# Reset since to the last available point
446446
# - 5 seconds (to ensure we're getting all trades)
447-
since = trades.iloc[-1]["timestamp"] - (5 * 1000)
447+
since = int(trades.iloc[-1]["timestamp"] - (5 * 1000))
448448
logger.info(
449449
f"Using last trade date -5s - Downloading trades for {pair} "
450450
f"since: {format_ms_time(since)}."

freqtrade/exchange/binance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def load_leverage_tiers(self) -> dict[str, list[dict]]:
363363
return {}
364364

365365
async def _async_get_trade_history_id_startup(
366-
self, pair: str, since: int | None
366+
self, pair: str, since: int
367367
) -> tuple[list[list], str]:
368368
"""
369369
override for initial call

freqtrade/exchange/exchange.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2960,15 +2960,15 @@ def _get_trade_pagination_next_value(self, trades: list[dict]):
29602960
return trades[-1].get("timestamp")
29612961

29622962
async def _async_get_trade_history_id_startup(
2963-
self, pair: str, since: int | None
2963+
self, pair: str, since: int
29642964
) -> tuple[list[list], str]:
29652965
"""
29662966
override for initial trade_history_id call
29672967
"""
29682968
return await self._async_fetch_trades(pair, since=since)
29692969

29702970
async def _async_get_trade_history_id(
2971-
self, pair: str, until: int, since: int | None = None, from_id: str | None = None
2971+
self, pair: str, *, until: int, since: int, from_id: str | None = None
29722972
) -> tuple[str, list[list]]:
29732973
"""
29742974
Asynchronously gets trade history using fetch_trades
@@ -3022,7 +3022,7 @@ async def _async_get_trade_history_id(
30223022
return (pair, trades)
30233023

30243024
async def _async_get_trade_history_time(
3025-
self, pair: str, until: int, since: int | None = None
3025+
self, pair: str, until: int, since: int
30263026
) -> tuple[str, list[list]]:
30273027
"""
30283028
Asynchronously gets trade history using fetch_trades,
@@ -3063,7 +3063,7 @@ async def _async_get_trade_history_time(
30633063
async def _async_get_trade_history(
30643064
self,
30653065
pair: str,
3066-
since: int | None = None,
3066+
since: int,
30673067
until: int | None = None,
30683068
from_id: str | None = None,
30693069
) -> tuple[str, list[list]]:
@@ -3094,7 +3094,7 @@ async def _async_get_trade_history(
30943094
def get_historic_trades(
30953095
self,
30963096
pair: str,
3097-
since: int | None = None,
3097+
since: int,
30983098
until: int | None = None,
30993099
from_id: str | None = None,
31003100
) -> tuple[str, list]:

0 commit comments

Comments
 (0)