mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Improve funding fee migration logic
This commit is contained in:
parent
983764ad0a
commit
f028bdf342
|
@ -413,6 +413,10 @@ class IDataHandler(ABC):
|
|||
f for f in paircombs if f[2] == CandleType.FUNDING_RATE and f[1] != ff_timeframe
|
||||
]
|
||||
|
||||
if funding_rate_combs:
|
||||
logger.warning(
|
||||
f'Migrating {len(funding_rate_combs)} funding fees to correct timeframe.')
|
||||
|
||||
for pair, timeframe, candletype in funding_rate_combs:
|
||||
old_name = self._pair_data_filename(self._datadir, pair, timeframe, candletype)
|
||||
new_name = self._pair_data_filename(self._datadir, pair, ff_timeframe, candletype)
|
||||
|
@ -422,8 +426,8 @@ class IDataHandler(ABC):
|
|||
continue
|
||||
|
||||
if Path(new_name).exists():
|
||||
logger.warning(f'{new_name} already exists, skipping.')
|
||||
continue
|
||||
logger.warning(f'{new_name} already exists, Removing.')
|
||||
Path(new_name).unlink()
|
||||
|
||||
Path(old_name).rename(new_name)
|
||||
|
||||
|
|
|
@ -23,7 +23,5 @@ def migrate_funding_fee_timeframe(config: Config, exchange: Optional[Exchange]):
|
|||
|
||||
ff_timeframe = exchange.get_option('funding_fee_timeframe')
|
||||
|
||||
logger.warning('Migrating funding fees to correct timeframe.')
|
||||
|
||||
dhc = get_datahandler(config['datadir'], config['dataformat_ohlcv'])
|
||||
dhc.fix_funding_fee_timeframe(ff_timeframe)
|
||||
|
|
Loading…
Reference in New Issue
Block a user