From 5812052d61dbfb7ee9d85740a9a08e5e8e002125 Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Sat, 4 Jan 2020 05:40:23 +0300 Subject: [PATCH] Add more 'bad' characters that appear in the market symbols on some exchanges --- freqtrade/data/history.py | 2 +- tests/data/test_history.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/freqtrade/data/history.py b/freqtrade/data/history.py index cfdd6008f..63e1ac1b7 100644 --- a/freqtrade/data/history.py +++ b/freqtrade/data/history.py @@ -225,7 +225,7 @@ def refresh_data(datadir: Path, def pair_to_filename(pair: str) -> str: - for ch in ['/', ' ', '.']: + for ch in ['/', '-', ' ', '.', '@', '$', '+', ':']: pair = pair.replace(ch, '_') return pair diff --git a/tests/data/test_history.py b/tests/data/test_history.py index 16bd2ff58..84872ad8b 100644 --- a/tests/data/test_history.py +++ b/tests/data/test_history.py @@ -152,6 +152,13 @@ def test_testdata_path(testdatadir) -> None: ("ETHH20", 'ETHH20'), (".XBTBON2H", '_XBTBON2H'), ("ETHUSD.d", 'ETHUSD_d'), + ("ADA-0327", 'ADA_0327'), + ("BTC-USD-200110", 'BTC_USD_200110'), + ("F-AKRO/USDT", 'F_AKRO_USDT'), + ("LC+/ETH", 'LC__ETH'), + ("CMT@18/ETH", 'CMT_18_ETH'), + ("LBTC:1022/SAI", 'LBTC_1022_SAI'), + ("$PAC/BTC", '_PAC_BTC'), ]) def test_pair_to_filename(pair, expected_result): pair_s = pair_to_filename(pair)