Skip to content

Commit

Permalink
Remove Explicit datadir conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Dec 28, 2019
1 parent 9c5b94a commit b37b5c3
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions freqtrade/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,15 @@ def start_list_strategies(args: Dict[str, Any]) -> None:
def convert_trades_format(config: Dict[str, Any], convert_from: str, convert_to: str):
"""
TODO: move this to converter.py (?)
TODO: remove Path conversation once PR is merged and this is rebased
"""
SrcClass = get_datahandlerclass(convert_from)
TrgClass = get_datahandlerclass(convert_to)

if 'pairs' not in config:
config['pairs'] = SrcClass.trades_get_pairs(Path(config['datadir']))
config['pairs'] = SrcClass.trades_get_pairs(config['datadir'])
logger.info(f"Converting trades for {config['pairs']}")
src = SrcClass(Path(config['datadir']))
trg = TrgClass(Path(config['datadir']))
src = SrcClass(config['datadir'])
trg = TrgClass(config['datadir'])
for pair in config['pairs']:
data = src.trades_load(pair=pair)
logger.info(f"Converting {len(data)} trades for {pair}")
Expand All @@ -270,7 +269,6 @@ def convert_trades_format(config: Dict[str, Any], convert_from: str, convert_to:
def convert_ohlcv_format(config: Dict[str, Any], convert_from: str, convert_to: str):
"""
TODO: move this to converter.py (?)
TODO: remove Path conversation once PR is merged and this is rebased
"""
SrcClass = get_datahandlerclass(convert_from)
TrgClass = get_datahandlerclass(convert_to)
Expand All @@ -281,12 +279,12 @@ def convert_ohlcv_format(config: Dict[str, Any], convert_from: str, convert_to:
config['pairs'] = []
# Check timeframes or fall back to ticker_interval.
for timeframe in timeframes:
config['pairs'].extend(SrcClass.ohlcv_get_pairs(Path(config['datadir']),
config['pairs'].extend(SrcClass.ohlcv_get_pairs(config['datadir'],
timeframe))
logger.info(f"Converting OHLCV for {config['pairs']}")

src = SrcClass(Path(config['datadir']))
trg = TrgClass(Path(config['datadir']))
src = SrcClass(config['datadir'])
trg = TrgClass(config['datadir'])

for timeframe in timeframes:
for pair in config['pairs']:
Expand Down

0 comments on commit b37b5c3

Please sign in to comment.