mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 02:12:01 +00:00
Slightly improve memory-usage of kraken-convert
This commit is contained in:
parent
a83b5abb51
commit
3aa2d0c30a
|
@ -41,7 +41,7 @@ def import_kraken_trades_from_csv(config: Config, convert_to: str):
|
|||
|
||||
if pairs_raw := config.get('pairs'):
|
||||
pairs = expand_pairlist(pairs_raw, [m[0] for m in markets])
|
||||
markets = [m for m in markets if m[0] in pairs]
|
||||
markets = {m for m in markets if m[0] in pairs}
|
||||
if not markets:
|
||||
logger.info(f"No data found for pairs {', '.join(pairs_raw)}.")
|
||||
return
|
||||
|
@ -61,17 +61,18 @@ def import_kraken_trades_from_csv(config: Config, convert_to: str):
|
|||
continue
|
||||
|
||||
trades = pd.concat(dfs, ignore_index=True)
|
||||
del dfs
|
||||
|
||||
trades.loc[:, 'timestamp'] = trades['timestamp'] * 1e3
|
||||
trades.loc[:, 'cost'] = trades['price'] * trades['amount']
|
||||
for col in DEFAULT_TRADES_COLUMNS:
|
||||
if col not in trades.columns:
|
||||
trades[col] = ''
|
||||
|
||||
trades.loc[:, col] = ''
|
||||
trades = trades[DEFAULT_TRADES_COLUMNS]
|
||||
trades = trades_convert_types(trades)
|
||||
|
||||
trades_df = trades_df_remove_duplicates(trades)
|
||||
del trades
|
||||
logger.info(f"{pair}: {len(trades_df)} trades, from "
|
||||
f"{trades_df['date'].min():{DATETIME_PRINT_FORMAT}} to "
|
||||
f"{trades_df['date'].max():{DATETIME_PRINT_FORMAT}}")
|
||||
|
|
Loading…
Reference in New Issue
Block a user