Simplify timeframe-transition

This commit is contained in:
Matthias
2022-05-16 19:53:01 +02:00
parent 2e65a1793d
commit 76637d3939
4 changed files with 14 additions and 13 deletions

View File

@@ -98,8 +98,7 @@ class IDataHandler(ABC):
:param candle_type: Any of the enum CandleType (must match trading mode!)
:return: True when deleted, false if file did not exist.
"""
filename = self._pair_data_filename(
self._datadir, pair, self.timeframe_to_file(timeframe), candle_type)
filename = self._pair_data_filename(self._datadir, pair, timeframe, candle_type)
if filename.exists():
filename.unlink()
return True
@@ -194,10 +193,14 @@ class IDataHandler(ABC):
datadir: Path,
pair: str,
timeframe: str,
candle_type: CandleType
candle_type: CandleType,
no_timeframe_modify: bool = False
) -> Path:
pair_s = misc.pair_to_filename(pair)
candle = ""
if not no_timeframe_modify:
timeframe = cls.timeframe_to_file(timeframe)
if candle_type != CandleType.SPOT:
datadir = datadir.joinpath('futures')
candle = f"-{candle_type}"