From cc998afb44eae73341d09d99caa796e56dd4f049 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 09:37:05 +0200 Subject: [PATCH 01/27] chore: explicitly disable hyperliquid websockets Add comment explaining the reason --- freqtrade/exchange/hyperliquid.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/freqtrade/exchange/hyperliquid.py b/freqtrade/exchange/hyperliquid.py index ae1de3b64..ac4df6e38 100644 --- a/freqtrade/exchange/hyperliquid.py +++ b/freqtrade/exchange/hyperliquid.py @@ -28,6 +28,8 @@ class Hyperliquid(Exchange): "stoploss_on_exchange": False, "exchange_has_overrides": {"fetchTrades": False}, "marketOrderRequiresPrice": True, + # ws causes tons of warnings on low timeframes due to low volume on many coins + "ws_enabled": False, } _ft_has_futures: FtHas = { "stoploss_on_exchange": True, From 1889a315a3be7136a558a873488abc9fa1de746b Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 09:41:48 +0200 Subject: [PATCH 02/27] chore: fix comment location --- freqtrade/exchange/exchange.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 31ece5ba4..925dc66f0 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -2596,10 +2596,10 @@ class Exchange: if ticks and cache: idx = -2 if drop_incomplete and len(ticks) > 1 else -1 self._pairs_last_refresh_time[(pair, timeframe, c_type)] = ticks[idx][0] - # keeping parsed dataframe in cache ohlcv_df = ohlcv_to_dataframe( ticks, timeframe, pair=pair, fill_missing=True, drop_incomplete=drop_incomplete ) + # keeping parsed dataframe in cache if cache: if (pair, timeframe, c_type) in self._klines: old = self._klines[(pair, timeframe, c_type)] From e77feafee057a1f1812a2692fd6939a636ee8759 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 09:52:05 +0200 Subject: [PATCH 03/27] fix: avoid unnecessary log message when filling ws message --- freqtrade/exchange/exchange.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 925dc66f0..d1977ca03 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -2596,8 +2596,10 @@ class Exchange: if ticks and cache: idx = -2 if drop_incomplete and len(ticks) > 1 else -1 self._pairs_last_refresh_time[(pair, timeframe, c_type)] = ticks[idx][0] + has_cache = cache and (pair, timeframe, c_type) in self._klines + # in case of existing cache, fill_missing happens after concatenation ohlcv_df = ohlcv_to_dataframe( - ticks, timeframe, pair=pair, fill_missing=True, drop_incomplete=drop_incomplete + ticks, timeframe, pair=pair, fill_missing=not has_cache, drop_incomplete=drop_incomplete ) # keeping parsed dataframe in cache if cache: From d0c3b302891fe97b9f81f138932f0f469517fb45 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 09:55:36 +0200 Subject: [PATCH 04/27] docs: add explanation message about "couldn't reuse" --- docs/faq.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/faq.md b/docs/faq.md index 07db8b6d7..9085a9226 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -159,6 +159,14 @@ This warning can point to one of the below problems: * Barely traded pair -> Check the pair on the exchange webpage, look at the timeframe your strategy uses. If the pair does not have any volume in some candles (usually visualized with a "volume 0" bar, and a "_" as candle), this pair did not have any trades in this timeframe. These pairs should ideally be avoided, as they can cause problems with order-filling. * API problem -> API returns wrong data (this only here for completeness, and should not happen with supported exchanges). +### I get the message "Couldn't reuse watch for xxx" in the log + +This is an informational message that the bot tried to use candles from the websocket, but the exchange didn't provide the right information. +This can happen if there was an interruption to the websocket connection - or if the pair didn't have any trades happen in the timeframe you are using. + +Freqtrade will handle this gracefully by falling back to the REST api. +While this makes the iteration slightly slower (due to the REST Api call) - it will not cause any problems to the bot's operation. + ### I'm getting the "Exchange XXX does not support market orders." message and cannot run my strategy As the message says, your exchange does not support market orders and you have one of the [order types](configuration.md/#understand-order_types) set to "market". Your strategy was probably written with other exchanges in mind and sets "market" orders for "stoploss" orders, which is correct and preferable for most of the exchanges supporting market orders (but not for Gate.io). From 1f52ff3f9446853902c1c36bcabee9c22a0254e0 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 10:20:48 +0200 Subject: [PATCH 05/27] feat: enable websocket support for hyperliquid This should be treated as experimental (experimental). --- freqtrade/exchange/hyperliquid.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/freqtrade/exchange/hyperliquid.py b/freqtrade/exchange/hyperliquid.py index ac4df6e38..033e68a15 100644 --- a/freqtrade/exchange/hyperliquid.py +++ b/freqtrade/exchange/hyperliquid.py @@ -28,8 +28,7 @@ class Hyperliquid(Exchange): "stoploss_on_exchange": False, "exchange_has_overrides": {"fetchTrades": False}, "marketOrderRequiresPrice": True, - # ws causes tons of warnings on low timeframes due to low volume on many coins - "ws_enabled": False, + "ws_enabled": True, } _ft_has_futures: FtHas = { "stoploss_on_exchange": True, From f889061b9556daf6ebfd3af2e9a9c5387c462f99 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 10:27:33 +0200 Subject: [PATCH 06/27] refactor: don't assume all exchanges support spot markets --- freqtrade/exchange/binance.py | 2 +- freqtrade/exchange/bybit.py | 4 ++-- freqtrade/exchange/exchange.py | 3 ++- freqtrade/exchange/exchange_utils.py | 2 +- freqtrade/exchange/gate.py | 4 ++-- freqtrade/exchange/hyperliquid.py | 3 ++- freqtrade/exchange/kraken.py | 2 +- freqtrade/exchange/okx.py | 2 +- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/freqtrade/exchange/binance.py b/freqtrade/exchange/binance.py index c9ed83b50..1a6bcc18f 100644 --- a/freqtrade/exchange/binance.py +++ b/freqtrade/exchange/binance.py @@ -63,7 +63,7 @@ class Binance(Exchange): } _supported_trading_mode_margin_pairs: list[tuple[TradingMode, MarginMode]] = [ - # TradingMode.SPOT always supported and not required in this list + (TradingMode.SPOT, MarginMode.NONE), # (TradingMode.MARGIN, MarginMode.CROSS), (TradingMode.FUTURES, MarginMode.CROSS), (TradingMode.FUTURES, MarginMode.ISOLATED), diff --git a/freqtrade/exchange/bybit.py b/freqtrade/exchange/bybit.py index dfadee4b1..56aacf31f 100644 --- a/freqtrade/exchange/bybit.py +++ b/freqtrade/exchange/bybit.py @@ -64,9 +64,9 @@ class Bybit(Exchange): } _supported_trading_mode_margin_pairs: list[tuple[TradingMode, MarginMode]] = [ - # TradingMode.SPOT always supported and not required in this list + (TradingMode.SPOT, MarginMode.NONE), + (TradingMode.FUTURES, MarginMode.ISOLATED), # (TradingMode.FUTURES, MarginMode.CROSS), - (TradingMode.FUTURES, MarginMode.ISOLATED) ] @property diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index d1977ca03..daa20a8e5 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -169,7 +169,8 @@ class Exchange: _ft_has_futures: FtHas = {} _supported_trading_mode_margin_pairs: list[tuple[TradingMode, MarginMode]] = [ - # TradingMode.SPOT always supported and not required in this list + # Non-defined exchanges only support spot mode. + (TradingMode.SPOT, MarginMode.NONE), ] def __init__( diff --git a/freqtrade/exchange/exchange_utils.py b/freqtrade/exchange/exchange_utils.py index a400fa123..027044393 100644 --- a/freqtrade/exchange/exchange_utils.py +++ b/freqtrade/exchange/exchange_utils.py @@ -110,7 +110,7 @@ def _build_exchange_list_entry( "trade_modes": [{"trading_mode": "spot", "margin_mode": ""}], } if resolved := exchangeClasses.get(mapped_exchange_name): - supported_modes = [{"trading_mode": "spot", "margin_mode": ""}] + [ + supported_modes = [ {"trading_mode": tm.value, "margin_mode": mm.value} for tm, mm in resolved["class"]._supported_trading_mode_margin_pairs ] diff --git a/freqtrade/exchange/gate.py b/freqtrade/exchange/gate.py index db53fdd84..2bdb2fbc8 100644 --- a/freqtrade/exchange/gate.py +++ b/freqtrade/exchange/gate.py @@ -55,10 +55,10 @@ class Gate(Exchange): } _supported_trading_mode_margin_pairs: list[tuple[TradingMode, MarginMode]] = [ - # TradingMode.SPOT always supported and not required in this list + (TradingMode.SPOT, MarginMode.NONE), # (TradingMode.MARGIN, MarginMode.CROSS), # (TradingMode.FUTURES, MarginMode.CROSS), - (TradingMode.FUTURES, MarginMode.ISOLATED) + (TradingMode.FUTURES, MarginMode.ISOLATED), ] @retrier diff --git a/freqtrade/exchange/hyperliquid.py b/freqtrade/exchange/hyperliquid.py index 033e68a15..a880a60df 100644 --- a/freqtrade/exchange/hyperliquid.py +++ b/freqtrade/exchange/hyperliquid.py @@ -41,7 +41,8 @@ class Hyperliquid(Exchange): } _supported_trading_mode_margin_pairs: list[tuple[TradingMode, MarginMode]] = [ - (TradingMode.FUTURES, MarginMode.ISOLATED) + (TradingMode.SPOT, MarginMode.NONE), + (TradingMode.FUTURES, MarginMode.ISOLATED), ] @property diff --git a/freqtrade/exchange/kraken.py b/freqtrade/exchange/kraken.py index e3158a851..d113aedd8 100644 --- a/freqtrade/exchange/kraken.py +++ b/freqtrade/exchange/kraken.py @@ -35,7 +35,7 @@ class Kraken(Exchange): } _supported_trading_mode_margin_pairs: list[tuple[TradingMode, MarginMode]] = [ - # TradingMode.SPOT always supported and not required in this list + (TradingMode.SPOT, MarginMode.NONE), # (TradingMode.MARGIN, MarginMode.CROSS), # (TradingMode.FUTURES, MarginMode.CROSS) ] diff --git a/freqtrade/exchange/okx.py b/freqtrade/exchange/okx.py index bd25fccea..a30769b51 100644 --- a/freqtrade/exchange/okx.py +++ b/freqtrade/exchange/okx.py @@ -49,7 +49,7 @@ class Okx(Exchange): } _supported_trading_mode_margin_pairs: list[tuple[TradingMode, MarginMode]] = [ - # TradingMode.SPOT always supported and not required in this list + (TradingMode.SPOT, MarginMode.NONE), # (TradingMode.MARGIN, MarginMode.CROSS), # (TradingMode.FUTURES, MarginMode.CROSS), (TradingMode.FUTURES, MarginMode.ISOLATED), From bc019d6b6dd98a5fe3fe7acc840d70706f96e26f Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 10:33:43 +0200 Subject: [PATCH 07/27] chore: Explicitly type variable --- freqtrade/exchange/exchange_utils.py | 4 ++-- freqtrade/ft_types/__init__.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/freqtrade/exchange/exchange_utils.py b/freqtrade/exchange/exchange_utils.py index 027044393..550aab2c3 100644 --- a/freqtrade/exchange/exchange_utils.py +++ b/freqtrade/exchange/exchange_utils.py @@ -27,7 +27,7 @@ from freqtrade.exchange.common import ( SUPPORTED_EXCHANGES, ) from freqtrade.exchange.exchange_utils_timeframe import timeframe_to_minutes, timeframe_to_prev_date -from freqtrade.ft_types import ValidExchangesType +from freqtrade.ft_types import TradeModeType, ValidExchangesType from freqtrade.util import FtPrecise @@ -110,7 +110,7 @@ def _build_exchange_list_entry( "trade_modes": [{"trading_mode": "spot", "margin_mode": ""}], } if resolved := exchangeClasses.get(mapped_exchange_name): - supported_modes = [ + supported_modes: list[TradeModeType] = [ {"trading_mode": tm.value, "margin_mode": mm.value} for tm, mm in resolved["class"]._supported_trading_mode_margin_pairs ] diff --git a/freqtrade/ft_types/__init__.py b/freqtrade/ft_types/__init__.py index 6cd74f7b2..87e2df4dd 100644 --- a/freqtrade/ft_types/__init__.py +++ b/freqtrade/ft_types/__init__.py @@ -8,4 +8,4 @@ from freqtrade.ft_types.backtest_result_type import ( get_BacktestResultType_default, ) from freqtrade.ft_types.plot_annotation_type import AnnotationType -from freqtrade.ft_types.valid_exchanges_type import ValidExchangesType +from freqtrade.ft_types.valid_exchanges_type import TradeModeType, ValidExchangesType From c5e3f7d0ba3439c1e70c891b869985ededa06dd5 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 10:42:28 +0200 Subject: [PATCH 08/27] chore: default trading-mode to first in supported list --- freqtrade/exchange/exchange.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index daa20a8e5..5f4164055 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -202,9 +202,13 @@ class Exchange: self._config.update(config) # Leverage properties - self.trading_mode: TradingMode = config.get("trading_mode", TradingMode.SPOT) + self.trading_mode: TradingMode = config.get( + "trading_mode", self._supported_trading_mode_margin_pairs[0][0] + ) self.margin_mode: MarginMode = ( - MarginMode(config.get("margin_mode")) if config.get("margin_mode") else MarginMode.NONE + MarginMode(config.get("margin_mode")) + if config.get("margin_mode") + else self._supported_trading_mode_margin_pairs[0][1] ) self.liquidation_buffer = config.get("liquidation_buffer", 0.05) From aedbe0d1d2fba11e5d9b22d27c07da5014d90ce1 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 11:44:22 +0200 Subject: [PATCH 09/27] chore: add spot to available trading modes --- tests/conftest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/conftest.py b/tests/conftest.py index d1cbac549..20826cef9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -258,6 +258,7 @@ def patch_exchange( "._supported_trading_mode_margin_pairs", PropertyMock( return_value=[ + (TradingMode.SPOT, MarginMode.NONE), (TradingMode.MARGIN, MarginMode.CROSS), (TradingMode.MARGIN, MarginMode.ISOLATED), (TradingMode.FUTURES, MarginMode.CROSS), From c4a29a017829f2eb10c404855274480871938265 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 12:45:46 +0200 Subject: [PATCH 10/27] test: ensure candle_type_def is set properly --- tests/strategy/test_strategy_helpers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/strategy/test_strategy_helpers.py b/tests/strategy/test_strategy_helpers.py index aeb46a4e4..605579191 100644 --- a/tests/strategy/test_strategy_helpers.py +++ b/tests/strategy/test_strategy_helpers.py @@ -354,6 +354,7 @@ def test_informative_decorator(mocker, default_conf_usdt, trading_mode): default_conf_usdt["strategy"] = "InformativeDecoratorTest" strategy = StrategyResolver.load_strategy(default_conf_usdt) exchange = get_patched_exchange(mocker, default_conf_usdt) + default_conf_usdt["candle_type_def"] = candle_def strategy.dp = DataProvider({}, exchange, None) mocker.patch.object( strategy.dp, "current_whitelist", return_value=["XRP/USDT", "LTC/USDT", "NEO/USDT"] From b24064d7063d6cd6388fe3fbaf8e4a086b40d5e4 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 12:46:50 +0200 Subject: [PATCH 11/27] refactor: move default trading mode determination to exchange --- freqtrade/configuration/configuration.py | 8 -------- freqtrade/exchange/exchange.py | 9 ++++++--- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/freqtrade/configuration/configuration.py b/freqtrade/configuration/configuration.py index b9da05d0c..c5e9b56e9 100644 --- a/freqtrade/configuration/configuration.py +++ b/freqtrade/configuration/configuration.py @@ -18,10 +18,7 @@ from freqtrade.constants import Config from freqtrade.enums import ( NON_UTIL_MODES, TRADE_MODES, - CandleType, - MarginMode, RunMode, - TradingMode, ) from freqtrade.exceptions import OperationalException from freqtrade.loggers import setup_logging @@ -397,11 +394,6 @@ class Configuration: self._args_to_config( config, argname="trading_mode", logstring="Detected --trading-mode: {}" ) - config["candle_type_def"] = CandleType.get_default( - config.get("trading_mode", "spot") or "spot" - ) - config["trading_mode"] = TradingMode(config.get("trading_mode", "spot") or "spot") - config["margin_mode"] = MarginMode(config.get("margin_mode", "") or "") self._args_to_config( config, argname="candle_types", logstring="Detected --candle-types: {}" ) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 5f4164055..4a0b37602 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -202,14 +202,17 @@ class Exchange: self._config.update(config) # Leverage properties - self.trading_mode: TradingMode = config.get( - "trading_mode", self._supported_trading_mode_margin_pairs[0][0] + self.trading_mode: TradingMode = TradingMode( + config.get("trading_mode", self._supported_trading_mode_margin_pairs[0][0]) ) - self.margin_mode: MarginMode = ( + self.margin_mode: MarginMode = MarginMode( MarginMode(config.get("margin_mode")) if config.get("margin_mode") else self._supported_trading_mode_margin_pairs[0][1] ) + config["trading_mode"] = self.trading_mode + config["margin_mode"] = self.margin_mode + config["candle_type_def"] = CandleType.get_default(self.trading_mode) self.liquidation_buffer = config.get("liquidation_buffer", 0.05) exchange_conf: ExchangeConfig = exchange_config if exchange_config else config["exchange"] From 469587e656443d2fd3d114a810e95450da5d1d99 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 13:08:44 +0200 Subject: [PATCH 12/27] feat: add modetrade exchange base config --- freqtrade/exchange/__init__.py | 1 + freqtrade/exchange/modetrade.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 freqtrade/exchange/modetrade.py diff --git a/freqtrade/exchange/__init__.py b/freqtrade/exchange/__init__.py index 8fd2ffb95..36aadcad1 100644 --- a/freqtrade/exchange/__init__.py +++ b/freqtrade/exchange/__init__.py @@ -44,4 +44,5 @@ from freqtrade.exchange.kraken import Kraken from freqtrade.exchange.kucoin import Kucoin from freqtrade.exchange.lbank import Lbank from freqtrade.exchange.luno import Luno +from freqtrade.exchange.modetrade import Modetrade from freqtrade.exchange.okx import Okx diff --git a/freqtrade/exchange/modetrade.py b/freqtrade/exchange/modetrade.py new file mode 100644 index 000000000..282017ea9 --- /dev/null +++ b/freqtrade/exchange/modetrade.py @@ -0,0 +1,28 @@ +import logging + +from freqtrade.enums.marginmode import MarginMode +from freqtrade.enums.tradingmode import TradingMode +from freqtrade.exchange import Exchange +from freqtrade.exchange.exchange_types import FtHas + + +logger = logging.getLogger(__name__) + + +class Modetrade(Exchange): + """ + MOdetrade exchange class. Contains adjustments needed for Freqtrade to work + with this exchange. + + Please note that this exchange is not included in the list of exchanges + officially supported by the Freqtrade development team. So some features + may still not work as expected. + """ + + _ft_has: FtHas = { + "always_require_api_keys": True, # Requires API keys to fetch candles + } + + # _supported_trading_mode_margin_pairs: list[tuple[TradingMode, MarginMode]] = [ + # (TradingMode.FUTURES, MarginMode.ISOLATED), + # ] From 3eaa862cafadfb59198824fcadefcadba4e080f9 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 13:34:03 +0200 Subject: [PATCH 13/27] chore: remove modetrade wrong imports --- freqtrade/exchange/modetrade.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/freqtrade/exchange/modetrade.py b/freqtrade/exchange/modetrade.py index 282017ea9..9c6baa9c9 100644 --- a/freqtrade/exchange/modetrade.py +++ b/freqtrade/exchange/modetrade.py @@ -1,7 +1,6 @@ import logging -from freqtrade.enums.marginmode import MarginMode -from freqtrade.enums.tradingmode import TradingMode +# from freqtrade.enums import MarginMode, TradingMode from freqtrade.exchange import Exchange from freqtrade.exchange.exchange_types import FtHas From 24f904efc464709b0464eb8537bb3c259b3b2f9d Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 15:41:00 +0200 Subject: [PATCH 14/27] test: fix failing test --- tests/freqai/test_freqai_backtesting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/freqai/test_freqai_backtesting.py b/tests/freqai/test_freqai_backtesting.py index c9be6ea05..503b0bdb8 100644 --- a/tests/freqai/test_freqai_backtesting.py +++ b/tests/freqai/test_freqai_backtesting.py @@ -142,7 +142,7 @@ def test_freqai_backtest_consistent_timerange(mocker, freqai_conf): gbs = mocker.patch("freqtrade.optimize.backtesting.generate_backtest_stats") - freqai_conf["candle_type_def"] = CandleType.FUTURES + freqai_conf["trading_mode"] = "futures" freqai_conf.get("exchange", {}).update({"pair_whitelist": ["XRP/USDT:USDT"]}) freqai_conf.get("freqai", {}).get("feature_parameters", {}).update( {"include_timeframes": ["5m", "1h"], "include_corr_pairlist": []} From 2236b08fc22653292158130ab6b898332aa3ac49 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 16:03:51 +0200 Subject: [PATCH 15/27] refactor: improved exchange init sequence --- freqtrade/exchange/exchange.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 4a0b37602..5c6f2cc1e 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -199,8 +199,6 @@ class Exchange: self.loop = self._init_async_loop() self._config: Config = {} - self._config.update(config) - # Leverage properties self.trading_mode: TradingMode = TradingMode( config.get("trading_mode", self._supported_trading_mode_margin_pairs[0][0]) @@ -213,6 +211,7 @@ class Exchange: config["trading_mode"] = self.trading_mode config["margin_mode"] = self.margin_mode config["candle_type_def"] = CandleType.get_default(self.trading_mode) + self._config.update(config) self.liquidation_buffer = config.get("liquidation_buffer", 0.05) exchange_conf: ExchangeConfig = exchange_config if exchange_config else config["exchange"] From 8c85448ed75cf2b0d8d64dc6862febc90ed642b6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Jul 2025 16:04:25 +0200 Subject: [PATCH 16/27] chore: remove unused import --- tests/freqai/test_freqai_backtesting.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/freqai/test_freqai_backtesting.py b/tests/freqai/test_freqai_backtesting.py index 503b0bdb8..fd825e106 100644 --- a/tests/freqai/test_freqai_backtesting.py +++ b/tests/freqai/test_freqai_backtesting.py @@ -10,7 +10,6 @@ from freqtrade.configuration.timerange import TimeRange from freqtrade.data import history from freqtrade.data.dataprovider import DataProvider from freqtrade.enums import RunMode -from freqtrade.enums.candletype import CandleType from freqtrade.exceptions import OperationalException from freqtrade.freqai.data_kitchen import FreqaiDataKitchen from freqtrade.optimize.backtesting import Backtesting From 002d8c402260484518ed86584967f9b70dd74783 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 04:21:02 +0000 Subject: [PATCH 17/27] chore(deps-dev): bump types-python-dateutil in the types group Bumps the types group with 1 update: [types-python-dateutil](https://github.com/typeshed-internal/stub_uploader). Updates `types-python-dateutil` from 2.9.0.20250516 to 2.9.0.20250708 - [Commits](https://github.com/typeshed-internal/stub_uploader/commits) --- updated-dependencies: - dependency-name: types-python-dateutil dependency-version: 2.9.0.20250708 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: types ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e8b49e6b3..9c25ed23e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -29,4 +29,4 @@ types-cachetools==6.0.0.20250525 types-filelock==3.2.7 types-requests==2.32.4.20250611 types-tabulate==0.9.0.20241207 -types-python-dateutil==2.9.0.20250516 +types-python-dateutil==2.9.0.20250708 From daced63d00db21a80d4d586f167fd858a6969312 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 04:25:44 +0000 Subject: [PATCH 18/27] chore(deps-dev): bump ruff from 0.12.2 to 0.12.3 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.12.2 to 0.12.3. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.12.2...0.12.3) --- updated-dependencies: - dependency-name: ruff dependency-version: 0.12.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e8b49e6b3..dc97b9e65 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,7 +6,7 @@ -r requirements-freqai-rl.txt -r docs/requirements-docs.txt -ruff==0.12.2 +ruff==0.12.3 mypy==1.16.1 pre-commit==4.2.0 pytest==8.4.1 From 7678a59b1f141274658f4d8a2ca4db1814bb9879 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 04:27:14 +0000 Subject: [PATCH 19/27] chore(deps): bump certifi from 2025.6.15 to 2025.7.14 Bumps [certifi](https://github.com/certifi/python-certifi) from 2025.6.15 to 2025.7.14. - [Commits](https://github.com/certifi/python-certifi/compare/2025.06.15...2025.07.14) --- updated-dependencies: - dependency-name: certifi dependency-version: 2025.7.14 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a41a39cfa..cf247d205 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,7 @@ humanize==4.12.3 cachetools==6.1.0 requests==2.32.4 urllib3==2.5.0 -certifi==2025.6.15 +certifi==2025.7.14 jsonschema==4.24.0 tabulate==0.9.0 pycoingecko==3.2.0 From f07134bf6690e65280c54c1d1e9645b6f9158285 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 04:28:19 +0000 Subject: [PATCH 20/27] chore(deps): bump fastapi from 0.115.14 to 0.116.1 Bumps [fastapi](https://github.com/fastapi/fastapi) from 0.115.14 to 0.116.1. - [Release notes](https://github.com/fastapi/fastapi/releases) - [Commits](https://github.com/fastapi/fastapi/compare/0.115.14...0.116.1) --- updated-dependencies: - dependency-name: fastapi dependency-version: 0.116.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a41a39cfa..a0e68d8f7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -36,7 +36,7 @@ orjson==3.10.18 sdnotify==0.3.2 # API Server -fastapi==0.115.14 +fastapi==0.116.1 pydantic==2.11.7 uvicorn==0.35.0 pyjwt==2.10.1 From 85492c108450bd5bc7365dc35ed5673d6ce6458d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 04:28:21 +0000 Subject: [PATCH 21/27] chore(deps): bump python-rapidjson from 1.20 to 1.21 Bumps [python-rapidjson](https://github.com/python-rapidjson/python-rapidjson) from 1.20 to 1.21. - [Changelog](https://github.com/python-rapidjson/python-rapidjson/blob/master/CHANGES.rst) - [Commits](https://github.com/python-rapidjson/python-rapidjson/compare/v1.20...v1.21) --- updated-dependencies: - dependency-name: python-rapidjson dependency-version: '1.21' dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- ft_client/requirements.txt | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ft_client/requirements.txt b/ft_client/requirements.txt index 433c0f392..ceca8a373 100644 --- a/ft_client/requirements.txt +++ b/ft_client/requirements.txt @@ -1,3 +1,3 @@ # Requirements for freqtrade client library requests==2.32.4 -python-rapidjson==1.20 +python-rapidjson==1.21 diff --git a/requirements.txt b/requirements.txt index a41a39cfa..f2178a9b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,7 +28,7 @@ rich==14.0.0 pyarrow==20.0.0; platform_machine != 'armv7l' # Load ticker files 30% faster -python-rapidjson==1.20 +python-rapidjson==1.21 # Properly format api responses orjson==3.10.18 From d2d283a4b22d7d2f168cf124ae01d994a43625c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 04:28:22 +0000 Subject: [PATCH 22/27] chore(deps): bump ccxt from 4.4.92 to 4.4.94 Bumps [ccxt](https://github.com/ccxt/ccxt) from 4.4.92 to 4.4.94. - [Release notes](https://github.com/ccxt/ccxt/releases) - [Changelog](https://github.com/ccxt/ccxt/blob/master/CHANGELOG.md) - [Commits](https://github.com/ccxt/ccxt/compare/v4.4.92...v4.4.94) --- updated-dependencies: - dependency-name: ccxt dependency-version: 4.4.94 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a41a39cfa..0fe129ce2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,7 @@ ft-pandas-ta==0.3.15 ta-lib==0.5.5 technical==1.5.1 -ccxt==4.4.92 +ccxt==4.4.94 cryptography==45.0.5 aiohttp==3.12.13 SQLAlchemy==2.0.41 From 0eed655e7c63ac7c24469624c903b36de9fef016 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 14 Jul 2025 06:42:42 +0200 Subject: [PATCH 23/27] chore: bump types-dateutil in pre-commit config --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 081056105..0081098de 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: - types-filelock==3.2.7 - types-requests==2.32.4.20250611 - types-tabulate==0.9.0.20241207 - - types-python-dateutil==2.9.0.20250516 + - types-python-dateutil==2.9.0.20250708 - scipy-stubs==1.16.0.2 - SQLAlchemy==2.0.41 # stages: [push] From 7c9fe22b9f7a94e51a20c930cb384555917b95b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 05:37:46 +0000 Subject: [PATCH 24/27] chore(deps): bump pandas from 2.3.0 to 2.3.1 Bumps [pandas](https://github.com/pandas-dev/pandas) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/pandas-dev/pandas/releases) - [Commits](https://github.com/pandas-dev/pandas/compare/v2.3.0...v2.3.1) --- updated-dependencies: - dependency-name: pandas dependency-version: 2.3.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0fe129ce2..7279b383c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ numpy==2.3.1 -pandas==2.3.0 +pandas==2.3.1 bottleneck==1.5.0 numexpr==2.11.0 # Indicator libraries From 6fdc0f1b22b21b09a9f4fd8da0482ad239cc526d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 05:37:47 +0000 Subject: [PATCH 25/27] chore(deps): bump aiohttp from 3.12.13 to 3.12.14 Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.12.13 to 3.12.14. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/aiohttp/compare/v3.12.13...v3.12.14) --- updated-dependencies: - dependency-name: aiohttp dependency-version: 3.12.14 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0fe129ce2..fd903ecf2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ technical==1.5.1 ccxt==4.4.94 cryptography==45.0.5 -aiohttp==3.12.13 +aiohttp==3.12.14 SQLAlchemy==2.0.41 python-telegram-bot==22.2 # can't be hard-pinned due to telegram-bot pinning httpx with ~ From e721a741ca281739e62142dffc6d648abe2b483f Mon Sep 17 00:00:00 2001 From: Freqtrade Bot <154552126+freqtrade-bot@users.noreply.github.com> Date: Tue, 15 Jul 2025 03:31:05 +0000 Subject: [PATCH 26/27] chore: update pre-commit hooks --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0081098de..64fbdbb89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,7 +44,7 @@ repos: - repo: https://github.com/charliermarsh/ruff-pre-commit # Ruff version. - rev: 'v0.12.2' + rev: 'v0.12.3' hooks: - id: ruff - id: ruff-format @@ -70,7 +70,7 @@ repos: )$ - repo: https://github.com/stefmolin/exif-stripper - rev: 1.0.0 + rev: 1.1.0 hooks: - id: strip-exif From 6e38b72601613826de784af810d49aa31aa8e40d Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 15 Jul 2025 07:05:41 +0200 Subject: [PATCH 27/27] chore: Improve pull request template to be clear against AI --- .github/PULL_REQUEST_TEMPLATE.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 90a10d4da..2b957abcf 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,10 @@ ## Summary