Merge pull request #3910 from matspi/dataformat-informative-pair
Dataformat informative pair
This commit is contained in:
commit
a262618809
@ -7,8 +7,8 @@ services:
|
|||||||
dockerfile: ".devcontainer/Dockerfile"
|
dockerfile: ".devcontainer/Dockerfile"
|
||||||
volumes:
|
volumes:
|
||||||
# Allow git usage within container
|
# Allow git usage within container
|
||||||
- "/home/${USER}/.ssh:/home/ftuser/.ssh:ro"
|
- "${HOME}/.ssh:/home/ftuser/.ssh:ro"
|
||||||
- "/home/${USER}/.gitconfig:/home/ftuser/.gitconfig:ro"
|
- "${HOME}/.gitconfig:/home/ftuser/.gitconfig:ro"
|
||||||
- ..:/freqtrade:cached
|
- ..:/freqtrade:cached
|
||||||
# Persist bash-history
|
# Persist bash-history
|
||||||
- freqtrade-vscode-server:/home/ftuser/.vscode-server
|
- freqtrade-vscode-server:/home/ftuser/.vscode-server
|
||||||
|
@ -88,7 +88,8 @@ class DataProvider:
|
|||||||
"""
|
"""
|
||||||
return load_pair_history(pair=pair,
|
return load_pair_history(pair=pair,
|
||||||
timeframe=timeframe or self._config['timeframe'],
|
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:
|
def get_pair_dataframe(self, pair: str, timeframe: str = None) -> DataFrame:
|
||||||
|
@ -52,6 +52,31 @@ def test_historic_ohlcv(mocker, default_conf, ohlcv_history):
|
|||||||
assert historymock.call_args_list[0][1]["timeframe"] == "5m"
|
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):
|
def test_get_pair_dataframe(mocker, default_conf, ohlcv_history):
|
||||||
default_conf["runmode"] = RunMode.DRY_RUN
|
default_conf["runmode"] = RunMode.DRY_RUN
|
||||||
timeframe = default_conf["timeframe"]
|
timeframe = default_conf["timeframe"]
|
||||||
|
Loading…
Reference in New Issue
Block a user