From a7a7c3712168c01bb8b35dec738cd9b7d0821084 Mon Sep 17 00:00:00 2001 From: Janne Sinivirta Date: Fri, 26 Jan 2018 11:25:35 +0200 Subject: [PATCH] add day counter to timeframe --- freqtrade/optimize/backtesting.py | 5 ++++- freqtrade/tests/optimize/test_backtesting.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 8e244bdda..a78c9e197 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -212,7 +212,10 @@ def start(args): preprocessed = optimize.tickerdata_to_dataframe(data) # Print timeframe min_date, max_date = get_timeframe(preprocessed) - logger.info('Measuring data from %s up to %s ...', min_date.isoformat(), max_date.isoformat()) + logger.info('Measuring data from %s up to %s (%s days)..', + min_date.isoformat(), + max_date.isoformat(), + (max_date-min_date).days) # Execute backtest and print results sell_profit_only = config.get('experimental', {}).get('sell_profit_only', False) use_sell_signal = config.get('experimental', {}).get('use_sell_signal', False) diff --git a/freqtrade/tests/optimize/test_backtesting.py b/freqtrade/tests/optimize/test_backtesting.py index f88cdd9b9..f5db4d037 100644 --- a/freqtrade/tests/optimize/test_backtesting.py +++ b/freqtrade/tests/optimize/test_backtesting.py @@ -193,7 +193,8 @@ def test_backtest_start(default_conf, mocker, caplog): # check the logs, that will contain the backtest result exists = ['Using max_open_trades: 1 ...', 'Using stake_amount: 0.001 ...', - 'Measuring data from 2017-11-14T21:17:00+00:00 up to 2017-11-14T22:59:00+00:00 ...'] + 'Measuring data from 2017-11-14T21:17:00+00:00 ' + 'up to 2017-11-14T22:59:00+00:00 (0 days)..'] for line in exists: assert ('freqtrade.optimize.backtesting', logging.INFO,