Skip to content

Commit 937bd89

Browse files
committed
fix: workaround for ccxt bybit stop_order bug
1 parent adce6e4 commit 937bd89

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

freqtrade/exchange/bybit.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,21 @@ def _get_params(
140140
params["position_idx"] = 0
141141
return params
142142

143+
def _get_stop_params(self, side: BuySell, ordertype: str, stop_price: float) -> dict:
144+
params = super()._get_stop_params(
145+
side=side,
146+
ordertype=ordertype,
147+
stop_price=stop_price,
148+
)
149+
# work around ccxt bug introduced in https://github.com/ccxt/ccxt/pull/25887
150+
# Where create_order ain't returning an ID any longer.
151+
params.update(
152+
{
153+
"method": "privatePostV5OrderCreate",
154+
}
155+
)
156+
return params
157+
143158
def _order_needs_price(self, side: BuySell, ordertype: str) -> bool:
144159
# Bybit requires price for market orders - but only for classic accounts,
145160
# and only in spot mode

0 commit comments

Comments
 (0)