Skip to content

Commit 6848f91

Browse files
authored
Merge pull request freqtrade#12613 from freqtrade/fix/binance
Fix binance futures stoploss Order handling
2 parents 97e2e0a + 6d2c30a commit 6848f91

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

freqtrade/exchange/binance.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
download_archive_trades,
1818
)
1919
from freqtrade.exchange.common import retrier
20-
from freqtrade.exchange.exchange_types import FtHas, Tickers
20+
from freqtrade.exchange.exchange_types import CcxtOrder, FtHas, Tickers
2121
from freqtrade.exchange.exchange_utils_timeframe import timeframe_to_msecs
2222
from freqtrade.misc import deep_merge_dicts, json_load
2323
from freqtrade.util import FtTTLCache
@@ -145,6 +145,20 @@ def additional_exchange_init(self) -> None:
145145
except ccxt.BaseError as e:
146146
raise OperationalException(e) from e
147147

148+
def fetch_stoploss_order(
149+
self, order_id: str, pair: str, params: dict | None = None
150+
) -> CcxtOrder:
151+
if self.trading_mode == TradingMode.FUTURES:
152+
params = params or {}
153+
params.update({"stop": True})
154+
return self.fetch_order(order_id, pair, params)
155+
156+
def cancel_stoploss_order(self, order_id: str, pair: str, params: dict | None = None) -> dict:
157+
if self.trading_mode == TradingMode.FUTURES:
158+
params = params or {}
159+
params.update({"stop": True})
160+
return self.cancel_order(order_id=order_id, pair=pair, params=params)
161+
148162
def get_historic_ohlcv(
149163
self,
150164
pair: str,

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ft-pandas-ta==0.3.16
77
ta-lib==0.6.8
88
technical==1.5.3
99

10-
ccxt==4.5.26
10+
ccxt==4.5.27
1111
cryptography==46.0.3
1212
aiohttp==3.13.2
1313
SQLAlchemy==2.0.44

0 commit comments

Comments
 (0)