From e8c122d5edb028d776d1688f7b07c5ef73558b17 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 19 Nov 2024 18:18:47 +0100 Subject: [PATCH] fix: bybit classic market buy orders require price closes #10872 --- freqtrade/exchange/bybit.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/freqtrade/exchange/bybit.py b/freqtrade/exchange/bybit.py index 405c5630d..72cfe52c0 100644 --- a/freqtrade/exchange/bybit.py +++ b/freqtrade/exchange/bybit.py @@ -140,6 +140,17 @@ class Bybit(Exchange): params["position_idx"] = 0 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 + return ( + ordertype != "market" + or ( + side == "buy" and not self.unified_account and self.trading_mode == TradingMode.SPOT + ) + or self._ft_has.get("marketOrderRequiresPrice", False) + ) + def dry_run_liquidation_price( self, pair: str,