mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-02-22 04:11:59 +00:00
fix: workaround for ccxt bybit stop_order bug
This commit is contained in:
@@ -140,6 +140,21 @@ class Bybit(Exchange):
|
||||
params["position_idx"] = 0
|
||||
return params
|
||||
|
||||
def _get_stop_params(self, side: BuySell, ordertype: str, stop_price: float) -> dict:
|
||||
params = super()._get_stop_params(
|
||||
side=side,
|
||||
ordertype=ordertype,
|
||||
stop_price=stop_price,
|
||||
)
|
||||
# work around ccxt bug introduced in https://github.com/ccxt/ccxt/pull/25887
|
||||
# Where create_order ain't returning an ID any longer.
|
||||
params.update(
|
||||
{
|
||||
"method": "privatePostV5OrderCreate",
|
||||
}
|
||||
)
|
||||
return params
|
||||
|
||||
def _order_needs_price(self, side: BuySell, ordertype: str) -> bool:
|
||||
# Bybit requires price for market orders - but only for classic accounts,
|
||||
# and only in spot mode
|
||||
|
||||
Reference in New Issue
Block a user