From c9acb1466ca5580a958d3dd8ed49ae671d77bf71 Mon Sep 17 00:00:00 2001 From: Joe Schr <8218910+TheJoeSchr@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:28:53 +0200 Subject: [PATCH 1/2] fix: orderflow data missing for plotting and other runmodes --- freqtrade/data/dataprovider.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/freqtrade/data/dataprovider.py b/freqtrade/data/dataprovider.py index b4950f515..e40228511 100644 --- a/freqtrade/data/dataprovider.py +++ b/freqtrade/data/dataprovider.py @@ -520,7 +520,7 @@ class DataProvider: return self._exchange.trades( (pair, timeframe or self._config["timeframe"], _candle_type), copy=copy ) - elif self.runmode in (RunMode.BACKTEST, RunMode.HYPEROPT): + else: data_handler = get_datahandler( self._config["datadir"], data_format=self._config["dataformat_trades"] ) @@ -529,9 +529,6 @@ class DataProvider: ) return trades_df - else: - return DataFrame() - def market(self, pair: str) -> Optional[Dict[str, Any]]: """ Return market data for the pair From 439658fcf1222b18363296dcb022719775ad4a16 Mon Sep 17 00:00:00 2001 From: Joe Schr <8218910+TheJoeSchr@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:50:27 +0200 Subject: [PATCH 2/2] fix: remove tests for orderflow data missing of other runmodes --- tests/data/test_dataprovider.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/data/test_dataprovider.py b/tests/data/test_dataprovider.py index 8656da10b..220aafef0 100644 --- a/tests/data/test_dataprovider.py +++ b/tests/data/test_dataprovider.py @@ -90,13 +90,6 @@ def test_historic_trades(mocker, default_conf, trades_history_df): assert isinstance(data, DataFrame) assert len(data) == len(trades_history_df) - # Random other runmode - default_conf["runmode"] = RunMode.UTIL_EXCHANGE - dp = DataProvider(default_conf, None) - data = dp.trades("UNITTEST/BTC", "5m") - assert isinstance(data, DataFrame) - assert len(data) == 0 - def test_historic_ohlcv_dataformat(mocker, default_conf, ohlcv_history): hdf5loadmock = MagicMock(return_value=ohlcv_history)