mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-16 21:01:14 +00:00
refactor(move function): refresh_latest_trades into dataprovider
needed here to be used for call before analyze also removes need for internal exchange function checking if public_trades is enabled
This commit is contained in:
@@ -2297,25 +2297,12 @@ class Exchange:
|
||||
now = timeframe_to_next_date(timeframe)
|
||||
return int((now - timedelta(seconds=move_to // 1000)).timestamp() * 1000)
|
||||
|
||||
|
||||
def refresh_latest_trades(self,
|
||||
pair_list: ListPairsWithTimeframes ,
|
||||
data_handler: Callable,# IDataHandler,
|
||||
*,
|
||||
cache: bool = True,
|
||||
) -> Dict[PairWithTimeframe, DataFrame]:
|
||||
use_public_trades = self._config.get(
|
||||
'exchange', {}).get('use_public_trades', False)
|
||||
if use_public_trades:
|
||||
return self._refresh_latest_trades(pair_list, data_handler, cache=cache)
|
||||
return {}
|
||||
|
||||
def _refresh_latest_trades(self,
|
||||
pair_list: ListPairsWithTimeframes ,
|
||||
data_handler: Callable,# IDataHandler,
|
||||
*,
|
||||
cache: bool = True,
|
||||
) -> Dict[PairWithTimeframe, DataFrame]:
|
||||
"""
|
||||
Refresh in-memory TRADES asynchronously and set `_trades` with the result
|
||||
Loops asynchronously over pair_list and downloads all pairs async (semi-parallel).
|
||||
|
||||
Reference in New Issue
Block a user