diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 394960042..bd543ff93 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -37,6 +37,7 @@ from freqtrade.plugins.protectionmanager import ProtectionManager from freqtrade.resolvers import ExchangeResolver, StrategyResolver from freqtrade.strategy.interface import IStrategy from freqtrade.strategy.strategy_wrapper import strategy_safe_wrapper +from freqtrade.util.binance_mig import migrate_binance_futures_data from freqtrade.wallets import Wallets @@ -157,6 +158,7 @@ class Backtesting: self._can_short = self.trading_mode != TradingMode.SPOT self._position_stacking: bool = self.config.get('position_stacking', False) self.enable_protections: bool = self.config.get('enable_protections', False) + migrate_binance_futures_data(config) self.init_backtest() diff --git a/tests/optimize/test_backtesting.py b/tests/optimize/test_backtesting.py index ef7cadc91..9c6086b44 100644 --- a/tests/optimize/test_backtesting.py +++ b/tests/optimize/test_backtesting.py @@ -549,6 +549,7 @@ def test_backtest__enter_trade_futures(default_conf_usdt, fee, mocker) -> None: default_conf_usdt['trading_mode'] = 'futures' default_conf_usdt['margin_mode'] = 'isolated' default_conf_usdt['stake_currency'] = 'USDT' + default_conf_usdt['datadir'] = Path(default_conf_usdt['datadir']) default_conf_usdt['exchange']['pair_whitelist'] = ['.*'] backtesting = Backtesting(default_conf_usdt) backtesting._set_strategy(backtesting.strategylist[0])