From 38fc5d680b937c7aff9ed148ecab34804dd9dfa0 Mon Sep 17 00:00:00 2001 From: Matthias Spiller Date: Sat, 31 Oct 2020 10:31:58 +0000 Subject: [PATCH 1/3] Enable usage of devcontainer for macOS users --- .devcontainer/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 7b5e64609..20ec247d1 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -7,8 +7,8 @@ services: dockerfile: ".devcontainer/Dockerfile" volumes: # Allow git usage within container - - "/home/${USER}/.ssh:/home/ftuser/.ssh:ro" - - "/home/${USER}/.gitconfig:/home/ftuser/.gitconfig:ro" + - "${HOME}/.ssh:/home/ftuser/.ssh:ro" + - "${HOME}/.gitconfig:/home/ftuser/.gitconfig:ro" - ..:/freqtrade:cached # Persist bash-history - freqtrade-vscode-server:/home/ftuser/.vscode-server From 78874fa86573f810d0c57e248651fc8aa1d80286 Mon Sep 17 00:00:00 2001 From: Matthias Spiller Date: Sat, 31 Oct 2020 10:53:51 +0000 Subject: [PATCH 2/3] informative_pairs does not honor dataformat --- freqtrade/data/dataprovider.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freqtrade/data/dataprovider.py b/freqtrade/data/dataprovider.py index 07dd94fc1..3ca38e865 100644 --- a/freqtrade/data/dataprovider.py +++ b/freqtrade/data/dataprovider.py @@ -88,7 +88,8 @@ class DataProvider: """ return load_pair_history(pair=pair, timeframe=timeframe or self._config['timeframe'], - datadir=self._config['datadir'] + datadir=self._config['datadir'], + data_format=self._config.get('dataformat_ohlcv', 'json') ) def get_pair_dataframe(self, pair: str, timeframe: str = None) -> DataFrame: From 0d11f0bd75da23e2c285778a435cb7cf2f65bff4 Mon Sep 17 00:00:00 2001 From: Matthias Spiller Date: Sat, 31 Oct 2020 11:45:46 +0000 Subject: [PATCH 3/3] Add unit test for hdf5 dataformat for informative pairs --- tests/data/test_dataprovider.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/data/test_dataprovider.py b/tests/data/test_dataprovider.py index a64dce908..a3c57a77b 100644 --- a/tests/data/test_dataprovider.py +++ b/tests/data/test_dataprovider.py @@ -52,6 +52,31 @@ def test_historic_ohlcv(mocker, default_conf, ohlcv_history): assert historymock.call_args_list[0][1]["timeframe"] == "5m" +def test_historic_ohlcv_dataformat(mocker, default_conf, ohlcv_history): + hdf5loadmock = MagicMock(return_value=ohlcv_history) + jsonloadmock = MagicMock(return_value=ohlcv_history) + mocker.patch("freqtrade.data.history.hdf5datahandler.HDF5DataHandler._ohlcv_load", hdf5loadmock) + mocker.patch("freqtrade.data.history.jsondatahandler.JsonDataHandler._ohlcv_load", jsonloadmock) + + default_conf["runmode"] = RunMode.BACKTEST + exchange = get_patched_exchange(mocker, default_conf) + dp = DataProvider(default_conf, exchange) + data = dp.historic_ohlcv("UNITTEST/BTC", "5m") + assert isinstance(data, DataFrame) + hdf5loadmock.assert_not_called() + jsonloadmock.assert_called_once() + + # Swiching to dataformat hdf5 + hdf5loadmock.reset_mock() + jsonloadmock.reset_mock() + default_conf["dataformat_ohlcv"] = "hdf5" + dp = DataProvider(default_conf, exchange) + data = dp.historic_ohlcv("UNITTEST/BTC", "5m") + assert isinstance(data, DataFrame) + hdf5loadmock.assert_called_once() + jsonloadmock.assert_not_called() + + def test_get_pair_dataframe(mocker, default_conf, ohlcv_history): default_conf["runmode"] = RunMode.DRY_RUN timeframe = default_conf["timeframe"]