backtesting takes its ticker_interval from the config file, else from the command line options

This commit is contained in:
Jean-Baptiste LE STANG 2018-01-13 08:55:45 +01:00
parent 2509ce030d
commit 7b292d5ca3
2 changed files with 5 additions and 5 deletions

View File

@ -171,7 +171,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,

View File

@ -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'])