From 0328caffe40f5e37d638a6e86d940304589a0e32 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste LE STANG Date: Sat, 13 Jan 2018 08:55:45 +0100 Subject: [PATCH] backtesting takes its ticker_interval from the config file, else from the command line options --- freqtrade/misc.py | 2 +- freqtrade/optimize/backtesting.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/freqtrade/misc.py b/freqtrade/misc.py index fe0e9525b..5282a0ae3 100644 --- a/freqtrade/misc.py +++ b/freqtrade/misc.py @@ -166,7 +166,7 @@ def build_subcommands(parser: argparse.ArgumentParser) -> None: ) backtesting_cmd.add_argument( '-i', '--ticker-interval', - help='specify ticker interval in minutes (default: 5)', + help='specify ticker interval in minutes (1, 5, 30, 60, 1440)', dest='ticker_interval', default=5, type=int, diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 6d600b303..2ae88f559 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -150,18 +150,18 @@ def start(args): logger.info('Using config: %s ...', args.config) config = misc.load_config(args.config) - - logger.info('Using ticker_interval: %s ...', args.ticker_interval) + ticker_interval = config.get('ticker_interval', args.ticker_interval) + logger.info('Using ticker_interval: %s ...', ticker_interval) data = {} pairs = config['exchange']['pair_whitelist'] if args.live: logger.info('Downloading data for all pairs in whitelist ...') for pair in pairs: - data[pair] = exchange.get_ticker_history(pair, args.ticker_interval) + data[pair] = exchange.get_ticker_history(pair, ticker_interval) else: logger.info('Using local backtesting data (using whitelist in given config) ...') - data = optimize.load_data(args.datadir, pairs=pairs, ticker_interval=args.ticker_interval, + data = optimize.load_data(args.datadir, pairs=pairs, ticker_interval=ticker_interval, refresh_pairs=args.refresh_pairs) logger.info('Using stake_currency: %s ...', config['stake_currency'])