Compare commits

...

5 Commits

Author SHA1 Message Date
Matthias 0beb76ce48 fix: function signature mismatch 2025-12-18 07:11:45 +01:00
Matthias f002ce67b1 chore: bump version to 2025.11.2 2025-12-18 07:02:17 +01:00
Matthias 5fdc8acbe9 test: switch to BTC/USDC in tests for now 2025-12-18 07:02:17 +01:00
Matthias 1811f9581f fix: allow set-leverage failures on followup orders 2025-12-18 06:56:07 +01:00
Matthias 66235f3198 fix: improve binance stoploss "triggered" behavior 2025-12-18 06:55:47 +01:00
7 changed files with 27 additions and 7 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
"""Freqtrade bot"""
__version__ = "2025.11.1"
__version__ = "2025.11.2"
if "dev" in __version__:
from pathlib import Path
+15 -1
View File
@@ -151,7 +151,21 @@ class Binance(Exchange):
if self.trading_mode == TradingMode.FUTURES:
params = params or {}
params.update({"stop": True})
return self.fetch_order(order_id, pair, params)
order = self.fetch_order(order_id, pair, params)
if self.trading_mode == TradingMode.FUTURES and order.get("status", "open") == "closed":
# Places a real order - which we need to fetch explicitly.
if new_orderid := order.get("info", {}).get("actualOrderId"):
order1 = self.fetch_order(order_id=new_orderid, pair=pair, params={})
order1["id_stop"] = order1["id"]
order1["id"] = order_id
order1["type"] = "stoploss"
order1["stopPrice"] = order.get("stopPrice")
order1["status_stop"] = "triggered"
return order1
return order
def cancel_stoploss_order(self, order_id: str, pair: str, params: dict | None = None) -> dict:
if self.trading_mode == TradingMode.FUTURES:
+3 -2
View File
@@ -1362,8 +1362,9 @@ class Exchange:
amount: float,
rate: float,
leverage: float,
reduceOnly: bool = False,
time_in_force: str = "GTC",
reduceOnly: bool = False,
initial_order: bool = True,
) -> CcxtOrder:
if self._config["dry_run"]:
dry_order = self.create_dry_run_order(
@@ -1380,7 +1381,7 @@ class Exchange:
rate_for_order = self.price_to_precision(pair, rate) if needs_price else None
if not reduceOnly:
self._lev_prep(pair, leverage, side)
self._lev_prep(pair, leverage, side, accept_fail=not initial_order)
order = self._api.create_order(
pair,
+3 -1
View File
@@ -44,8 +44,9 @@ class Kucoin(Exchange):
amount: float,
rate: float,
leverage: float,
reduceOnly: bool = False,
time_in_force: str = "GTC",
reduceOnly: bool = False,
initial_order: bool = True,
) -> CcxtOrder:
res = super().create_order(
pair=pair,
@@ -56,6 +57,7 @@ class Kucoin(Exchange):
leverage=leverage,
reduceOnly=reduceOnly,
time_in_force=time_in_force,
initial_order=initial_order,
)
# Kucoin returns only the order-id.
# ccxt returns status = 'closed' at the moment - which is information ccxt invented.
+2
View File
@@ -937,6 +937,7 @@ class FreqtradeBot(LoggingMixin):
reduceOnly=False,
time_in_force=time_in_force,
leverage=leverage,
initial_order=trade is None,
)
order_obj = Order.parse_from_ccxt_object(order, pair, side, amount, enter_limit_requested)
order_obj.ft_order_tag = enter_tag
@@ -2131,6 +2132,7 @@ class FreqtradeBot(LoggingMixin):
leverage=trade.leverage,
reduceOnly=self.trading_mode == TradingMode.FUTURES,
time_in_force=time_in_force,
initial_order=False,
)
except InsufficientFundsError as e:
logger.warning(f"Unable to place order {e}.")
+1 -1
View File
@@ -1,7 +1,7 @@
from freqtrade_client.ft_rest_client import FtRestClient
__version__ = "2025.11.1"
__version__ = "2025.11.2"
if "dev" in __version__:
from pathlib import Path
+2 -1
View File
@@ -515,7 +515,8 @@ EXCHANGES = {
],
},
"hyperliquid": {
"pair": "UBTC/USDC",
# TODO: Should be UBTC/USDC - probably needs a fix in ccxt
"pair": "BTC/USDC",
"stake_currency": "USDC",
"hasQuoteVolume": False,
"timeframe": "30m",