mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
chore: make some internal fetch-trades methods require since
This commit is contained in:
@@ -444,7 +444,7 @@ def _download_trades_history(
|
|||||||
if not trades.empty and since < trades.iloc[-1]["timestamp"]:
|
if not trades.empty and since < trades.iloc[-1]["timestamp"]:
|
||||||
# Reset since to the last available point
|
# Reset since to the last available point
|
||||||
# - 5 seconds (to ensure we're getting all trades)
|
# - 5 seconds (to ensure we're getting all trades)
|
||||||
since = trades.iloc[-1]["timestamp"] - (5 * 1000)
|
since = int(trades.iloc[-1]["timestamp"] - (5 * 1000))
|
||||||
logger.info(
|
logger.info(
|
||||||
f"Using last trade date -5s - Downloading trades for {pair} "
|
f"Using last trade date -5s - Downloading trades for {pair} "
|
||||||
f"since: {format_ms_time(since)}."
|
f"since: {format_ms_time(since)}."
|
||||||
|
|||||||
@@ -363,7 +363,7 @@ class Binance(Exchange):
|
|||||||
return {}
|
return {}
|
||||||
|
|
||||||
async def _async_get_trade_history_id_startup(
|
async def _async_get_trade_history_id_startup(
|
||||||
self, pair: str, since: int | None
|
self, pair: str, since: int
|
||||||
) -> tuple[list[list], str]:
|
) -> tuple[list[list], str]:
|
||||||
"""
|
"""
|
||||||
override for initial call
|
override for initial call
|
||||||
|
|||||||
@@ -2960,7 +2960,7 @@ class Exchange:
|
|||||||
return trades[-1].get("timestamp")
|
return trades[-1].get("timestamp")
|
||||||
|
|
||||||
async def _async_get_trade_history_id_startup(
|
async def _async_get_trade_history_id_startup(
|
||||||
self, pair: str, since: int | None
|
self, pair: str, since: int
|
||||||
) -> tuple[list[list], str]:
|
) -> tuple[list[list], str]:
|
||||||
"""
|
"""
|
||||||
override for initial trade_history_id call
|
override for initial trade_history_id call
|
||||||
@@ -2968,7 +2968,7 @@ class Exchange:
|
|||||||
return await self._async_fetch_trades(pair, since=since)
|
return await self._async_fetch_trades(pair, since=since)
|
||||||
|
|
||||||
async def _async_get_trade_history_id(
|
async def _async_get_trade_history_id(
|
||||||
self, pair: str, until: int, since: int | None = None, from_id: str | None = None
|
self, pair: str, *, until: int, since: int, from_id: str | None = None
|
||||||
) -> tuple[str, list[list]]:
|
) -> tuple[str, list[list]]:
|
||||||
"""
|
"""
|
||||||
Asynchronously gets trade history using fetch_trades
|
Asynchronously gets trade history using fetch_trades
|
||||||
@@ -3022,7 +3022,7 @@ class Exchange:
|
|||||||
return (pair, trades)
|
return (pair, trades)
|
||||||
|
|
||||||
async def _async_get_trade_history_time(
|
async def _async_get_trade_history_time(
|
||||||
self, pair: str, until: int, since: int | None = None
|
self, pair: str, until: int, since: int
|
||||||
) -> tuple[str, list[list]]:
|
) -> tuple[str, list[list]]:
|
||||||
"""
|
"""
|
||||||
Asynchronously gets trade history using fetch_trades,
|
Asynchronously gets trade history using fetch_trades,
|
||||||
@@ -3063,7 +3063,7 @@ class Exchange:
|
|||||||
async def _async_get_trade_history(
|
async def _async_get_trade_history(
|
||||||
self,
|
self,
|
||||||
pair: str,
|
pair: str,
|
||||||
since: int | None = None,
|
since: int,
|
||||||
until: int | None = None,
|
until: int | None = None,
|
||||||
from_id: str | None = None,
|
from_id: str | None = None,
|
||||||
) -> tuple[str, list[list]]:
|
) -> tuple[str, list[list]]:
|
||||||
@@ -3094,7 +3094,7 @@ class Exchange:
|
|||||||
def get_historic_trades(
|
def get_historic_trades(
|
||||||
self,
|
self,
|
||||||
pair: str,
|
pair: str,
|
||||||
since: int | None = None,
|
since: int,
|
||||||
until: int | None = None,
|
until: int | None = None,
|
||||||
from_id: str | None = None,
|
from_id: str | None = None,
|
||||||
) -> tuple[str, list]:
|
) -> tuple[str, list]:
|
||||||
|
|||||||
Reference in New Issue
Block a user