When placing an order on the bybit testnet:
https://testnet.bybit.com/
The filled Partial tp/sl are not taken into account by the server/exchange on Bybit side.
The order is the following:
open_position = session.place_order(
category="linear",
symbol=symbol,
side="Buy",
orderType="Market",
qty=0.02,
price = str(current_price),
timeInForce="GTC",
takeProfit= str(tp) ,
stopLoss= str(sl) ,
tpslMode = "Partial",
tpLimitPrice= str(tpLimitPrice) ,
slLimitPrice= str(slLimitPrice) ,
slOrderType= "Limit",
tpOrderType= "Limit",
)
when I getting the created position I obtain the following values:
get position
{‘retCode’: 0, ‘retMsg’: ‘OK’, ‘result’: {‘nextPageCursor’: ‘BTCUSDT%2C1716196294406%2C0’, ‘category’: ‘linear’, ‘list’: [{‘symbol’: ‘BTCUSDT’, ‘leverage’: ’10’, ‘autoAddMargin’: 0, ‘avgPrice’: ‘66879’, ‘liqPrice’: ”, ‘riskLimitValue’: ‘2000000’, ‘takeProfit’: ”, ‘positionValue’: ‘2675.16’, ‘isReduceOnly’: False, ‘tpslMode’: ‘Full’, ‘riskId’: 1, ‘trailingStop’: ‘0’, ‘unrealisedPnl’: ‘-0.88’, ‘markPrice’: ‘66857’, ‘adlRankIndicator’: 1, ‘cumRealisedPnl’: ‘-1219.55306143’, ‘positionMM’: ‘14.7000042’, ‘createdTime’: ‘1713947193915’, ‘positionIdx’: 0, ‘positionIM’: ‘268.8402042’, ‘seq’: 9224765210, ‘updatedTime’: ‘1716196294406’, ‘side’: ‘Buy’, ‘bustPrice’: ”, ‘positionBalance’: ‘0’, ‘leverageSysUpdatedTime’: ”, ‘curRealisedPnl’: ‘-0.535032’, ‘size’: ‘0.04’, ‘positionStatus’: ‘Normal’, ‘mmrSysUpdatedTime’: ”, ‘stopLoss’: ”, ‘tradeMode’: 0, ‘sessionAvgPrice’: ”}]}, ‘retExtInfo’: {}, ‘time’: 1716196302813}
positionValue usdt: 2675.16
takeProfit usdt:
stopLoss usdt:
tpslMode usdt: Full
size usdt: 0.04
cumRealisedPnl usdt: -1219.55306143
tradeMode usdt: 0
As we can see not only the exchange did not took the partial tp/sl into account (tpslMode is in Full) but it did not even consider the regular tp/sl.
On the opposite if I remove the partial part as well as the partial tp/sl. The exchange take the regular tp/sl into account.
What am I missing there?
RiceHarvesterMkII is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.