Skip to content

Commit 93bde7d

Browse files
committed
fix: support binance algo orders
closes freqtrade#12610
1 parent 97e2e0a commit 93bde7d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
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,

0 commit comments

Comments
 (0)