Skip to content

Commit

Permalink
Backtesting: Add the Interval required when data is missing
Browse files Browse the repository at this point in the history
Change the message:
"No data for pair ETH/BTC, use --refresh-pairs-cached to download the data"
for:
"No data for pair: "ETH/BTC", Interval: 5m. Use --refresh-pairs-cached to download the data"

The message structure is unified with the download message:
"Download the pair: "ETH/BTC", Interval: 5m"
  • Loading branch information
glonlas committed Jun 2, 2018
1 parent 5e99df1 commit 127cf5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions freqtrade/optimize/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ def load_data(datadir: str,
result[pair] = pairdata
else:
logger.warning(
'No data for pair %s, use --refresh-pairs-cached to download the data',
pair
'No data for pair: "%s", Interval: %s. '
'Use --refresh-pairs-cached to download the data',
pair,
ticker_interval
)

return result
Expand Down
3 changes: 2 additions & 1 deletion freqtrade/tests/optimize/test_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ def test_load_data_with_new_pair_1min(ticker_history, mocker, caplog) -> None:
refresh_pairs=False,
pairs=['MEME/BTC'])
assert os.path.isfile(file) is False
assert log_has('No data for pair MEME/BTC, use --refresh-pairs-cached to download the data',
assert log_has('No data for pair: "MEME/BTC", Interval: 1m. '
'Use --refresh-pairs-cached to download the data',
caplog.record_tuples)

# download a new pair if refresh_pairs is set
Expand Down

0 comments on commit 127cf5d

Please sign in to comment.