Bybit: tpslMode="Full" incorrectly requires market entry order type
Operating System
Linux Mint
Programming Language
Python
CCXT Version
4.5.22
Description
CCXT Bug Report: Bybit tpslMode="Full" incorrectly requires market entry order
Summary
CCXT incorrectly validates that the entry order type must be market when using tpslMode=Full for Bybit. However, Bybit API documentation only requires tpOrderType/slOrderType to be Market, not the entry order itself.
CCXT Version
4.5.22 (latest as of 2025-12-01)
Bug Location
File: ccxt/bybit.py lines 3921-3922
if isLimit and isFullTpsl:
raise InvalidOrder(self.id + ' tpsl orders with "full" tpslMode only support "market" type')
The isLimit variable checks if the entry order is a limit order, but per Bybit docs, only tpOrderType/slOrderType need to be Market for Full mode.
Expected Behavior
- When
tpslMode=Full, CCXT should allow limit entry orders - CCXT should only validate that
tpOrderTypeandslOrderTypeareMarket(which it already sets correctly)
Actual Behavior
CCXT raises InvalidOrder when trying to place a limit entry order with tpslMode=Full, even though Bybit API supports this.
Bybit Documentation Reference
From Bybit V5 Place Order API:
tpslMode (string):
Full: entire position for TP/SL. Then, tpOrderType or slOrderType must be MarketPartial: partial position tp/sl. Limit TP/SL order are supported.
tpOrderType (string): The order type when take profit is triggered
- For
tpslMode=Full, it only supportstpOrderType=Market
The docs clearly state that tpOrderType (the TP trigger order) must be Market, NOT the entry orderType.
Reproduction Steps
import ccxt
bybit = ccxt.bybit({
'apiKey': 'YOUR_API_KEY',
'secret': 'YOUR_SECRET',
})
# This SHOULD work per Bybit docs, but CCXT raises InvalidOrder
order = bybit.create_order(
symbol='BTC/USDT:USDT',
type='limit', # Entry order type - should be allowed
side='buy',
amount=0.001,
price=50000,
params={
'takeProfitPrice': 55000,
'tpslMode': 'Full', # This triggers the incorrect validation
}
)
@oryusan Thanks for reporting it, we will take a look as soon as possible.
I'll post an update about this issue
@oryusan the above linked PR would solve this issue. note, after new version gets released, you will be able to use it, but you will no longer be required to pass tpslMode, because our implementation will choose either Partial or Full automatically
Is this now implemented in the latest Version 4.5.26?
@oryusan Sorry not yet we haven't reached a final decision yet